From 74fb205876be681d2ca9d8bdd23e171e671df5e1 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Fri, 2 Feb 2024 19:55:36 +0100 Subject: [libc++][format] Improves tests. (#76291) Tests the returned type. This was first done for the vector formatters. This adds it to the other formatters where it wasn't done yet. --- .../format.formatter/format.formatter.spec/formatter.bool.pass.cpp | 2 +- .../format.formatter/format.formatter.spec/formatter.c_string.pass.cpp | 2 +- .../format.formatter/format.formatter.spec/formatter.char.pass.cpp | 2 +- .../format.formatter.spec/formatter.char_array.pass.cpp | 2 +- .../format.formatter.spec/formatter.floating_point.pass.cpp | 2 +- .../format.formatter/format.formatter.spec/formatter.handle.pass.cpp | 2 +- .../format.formatter/format.formatter.spec/formatter.pointer.pass.cpp | 2 +- .../format.formatter.spec/formatter.signed_integral.pass.cpp | 2 +- .../format.formatter/format.formatter.spec/formatter.string.pass.cpp | 2 +- .../format.formatter.spec/formatter.unsigned_integral.pass.cpp | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'libcxx') diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp index d326b2b..efea288 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.bool.pass.cpp @@ -37,7 +37,7 @@ void test(StringT expected, StringViewT fmt, bool arg, std::size_t offset) { std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); StringT result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp index 6d7fd1b..f363bc3 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.c_string.pass.cpp @@ -37,7 +37,7 @@ void test(StringT expected, StringViewT fmt, const CharT* a, std::size_t offset) std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); StringT result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp index 0b74ebb..554def9 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char.pass.cpp @@ -38,7 +38,7 @@ void test(StringT expected, StringViewT fmt, ArgumentT arg, std::size_t offset) std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); StringT result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp index 7c1e1c0..295ba7f 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp @@ -50,7 +50,7 @@ struct Tester { std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as::iterator> auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); std::basic_string result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp index 2df7834..206b021 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.floating_point.pass.cpp @@ -48,7 +48,7 @@ void test(std::basic_string_view fmt, ArithmeticT arg, std::basic_string< std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as::iterator> auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); std::basic_string result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp index 8fb4ebe..e2b3d6b 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp @@ -42,7 +42,7 @@ void test(std::string expected, std::string_view fmt, color arg, std::size_t off std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); std::string result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp index ff5bfe0..aa10f34 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.pointer.pass.cpp @@ -43,7 +43,7 @@ void test(StringT expected, StringViewT fmt, PointerT arg, std::size_t offset) { std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); StringT result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp index 6f827ef..e5db5da 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.signed_integral.pass.cpp @@ -45,7 +45,7 @@ void test(StringT expected, StringViewT fmt, ArithmeticT arg, std::size_t offset std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); StringT result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp index e99deb2..73df746 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.string.pass.cpp @@ -45,7 +45,7 @@ void test(StringT expected, StringViewT fmt, StringT a, std::size_t offset) { std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); StringT result; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp index 2a412ea..eb70115 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.unsigned_integral.pass.cpp @@ -45,7 +45,7 @@ void test(StringT expected, StringViewT fmt, ArithmeticT arg, std::size_t offset std::formatter formatter; static_assert(std::semiregular); - auto it = formatter.parse(parse_ctx); + std::same_as auto it = formatter.parse(parse_ctx); assert(it == fmt.end() - offset); StringT result; -- cgit v1.1