[libcxx-commits] [libcxx] 7941e5d - [libc++][print] Fixes tests.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 18 12:50:32 PDT 2023


Author: Mark de Wever
Date: 2023-07-18T21:49:26+02:00
New Revision: 7941e5df762cea2354e8d748cfd74ca20e008db5

URL: https://github.com/llvm/llvm-project/commit/7941e5df762cea2354e8d748cfd74ca20e008db5
DIFF: https://github.com/llvm/llvm-project/commit/7941e5df762cea2354e8d748cfd74ca20e008db5.diff

LOG: [libc++][print] Fixes tests.

The exception message improvements for `<format>` were not applied to
print. The issue has been reported by Ian Anderson.

Added: 
    

Modified: 
    libcxx/test/std/input.output/iostream.format/print.fun/print_tests.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/iostream.format/print.fun/print_tests.h b/libcxx/test/std/input.output/iostream.format/print.fun/print_tests.h
index 46b6eebab6a961..d28256cabc7986 100644
--- a/libcxx/test/std/input.output/iostream.format/print.fun/print_tests.h
+++ b/libcxx/test/std/input.output/iostream.format/print.fun/print_tests.h
@@ -74,10 +74,10 @@ void print_tests(TestFunction check, ExceptionTest check_exception) {
   check_exception("The format string contains an invalid escape sequence", "{:}-}", 42);
 
   check_exception("The format string contains an invalid escape sequence", "} ");
-  check_exception("The arg-id of the format-spec starts with an invalid character", "{-", 42);
-  check_exception("Argument index out of bounds", "hello {}");
-  check_exception("Argument index out of bounds", "hello {0}");
-  check_exception("Argument index out of bounds", "hello {1}", 42);
+  check_exception("The argument index starts with an invalid character", "{-", 42);
+  check_exception("The argument index value is too large for the number of arguments supplied", "hello {}");
+  check_exception("The argument index value is too large for the number of arguments supplied", "hello {0}");
+  check_exception("The argument index value is too large for the number of arguments supplied", "hello {1}", 42);
 }
 
 #endif // TEST_STD_INPUT_OUTPUT_IOSTREAM_FORMAT_PRINT_FUN_PRINT_TESTS_H


        


More information about the libcxx-commits mailing list