aboutsummaryrefslogtreecommitdiff
path: root/libcxx
diff options
context:
space:
mode:
authorMark de Wever <koraq@xs4all.nl>2023-06-04 21:32:10 +0200
committerMark de Wever <koraq@xs4all.nl>2023-07-18 21:11:12 +0200
commit402eb2ef099f6b5ea71420399f5236eb7faf9c5f (patch)
tree1d808a00b4f0f9681a2fee73aadcc1b033e8c78e /libcxx
parent97c5381879d41cafaf36793e57e236da8a81791f (diff)
downloadllvm-402eb2ef099f6b5ea71420399f5236eb7faf9c5f.zip
llvm-402eb2ef099f6b5ea71420399f5236eb7faf9c5f.tar.gz
llvm-402eb2ef099f6b5ea71420399f5236eb7faf9c5f.tar.bz2
[libc++][format] Improves diagnostics.
Improves both the compile-time and run-time errors. At compile-time it does a bit more work to get more specific errors. This could be done at run-time too, but that has a performance penalty. Since it's expected most use-cases use format* instead of vformat* the compile-time errors are more common. For example when using std::format_to("{:-c}", 42); Before compile output would contain std::__throw_format_error("The format-spec should consume the input or end with a '}'"); Now it contains std::__throw_format_error("The format specifier does not allow the sign option"); Given a better indication the sign option is not allowed. Note the output is still not user-friendly; C++ doesn't have good facilities to generate nice messages from the library. In general all messages have been reviewed and improved, using a more consistent style and using less terms used in the standard. For example format-spec -> format specifier arg-id -> argument index Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D152624
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/__chrono/formatter.h12
-rw-r--r--libcxx/include/__chrono/parser_std_format_spec.h6
-rw-r--r--libcxx/include/__format/format_functions.h10
-rw-r--r--libcxx/include/__format/format_string.h4
-rw-r--r--libcxx/include/__format/formatter_tuple.h4
-rw-r--r--libcxx/include/__format/parser_std_format_spec.h26
-rw-r--r--libcxx/include/__format/range_formatter.h12
-rw-r--r--libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h335
-rw-r--r--libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h38
-rw-r--r--libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h6
-rw-r--r--libcxx/test/std/time/time.syn/formatter.day.pass.cpp8
-rw-r--r--libcxx/test/std/time/time.syn/formatter.duration.pass.cpp8
-rw-r--r--libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp8
-rw-r--r--libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp29
-rw-r--r--libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp9
-rw-r--r--libcxx/test/std/time/time.syn/formatter.month.pass.cpp26
-rw-r--r--libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp26
-rw-r--r--libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp30
-rw-r--r--libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp34
-rw-r--r--libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp9
-rw-r--r--libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp16
-rw-r--r--libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp16
-rw-r--r--libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp20
-rw-r--r--libcxx/test/std/time/time.syn/formatter.year.pass.cpp8
-rw-r--r--libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp12
-rw-r--r--libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp156
-rw-r--r--libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp78
-rw-r--r--libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp54
-rw-r--r--libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp24
-rw-r--r--libcxx/test/std/utilities/format/format.functions/fill.unicode.pass.cpp50
-rw-r--r--libcxx/test/std/utilities/format/format.functions/format_tests.h69
-rw-r--r--libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h402
-rw-r--r--libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h561
-rw-r--r--libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h96
-rw-r--r--libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h485
-rw-r--r--libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h114
-rw-r--r--libcxx/test/support/format.functions.common.h4
37 files changed, 1449 insertions, 1356 deletions
diff --git a/libcxx/include/__chrono/formatter.h b/libcxx/include/__chrono/formatter.h
index 3793b53..30ed360 100644
--- a/libcxx/include/__chrono/formatter.h
+++ b/libcxx/include/__chrono/formatter.h
@@ -513,19 +513,19 @@ __format_chrono(const _Tp& __value,
} else {
// Test __weekday_name_ before __weekday_ to give a better error.
if (__specs.__chrono_.__weekday_name_ && !__formatter::__weekday_name_ok(__value))
- std::__throw_format_error("formatting a weekday name needs a valid weekday");
+ std::__throw_format_error("Formatting a weekday name needs a valid weekday");
if (__specs.__chrono_.__weekday_ && !__formatter::__weekday_ok(__value))
- std::__throw_format_error("formatting a weekday needs a valid weekday");
+ std::__throw_format_error("Formatting a weekday needs a valid weekday");
if (__specs.__chrono_.__day_of_year_ && !__formatter::__date_ok(__value))
- std::__throw_format_error("formatting a day of year needs a valid date");
+ std::__throw_format_error("Formatting a day of year needs a valid date");
if (__specs.__chrono_.__week_of_year_ && !__formatter::__date_ok(__value))
- std::__throw_format_error("formatting a week of year needs a valid date");
+ std::__throw_format_error("Formatting a week of year needs a valid date");
if (__specs.__chrono_.__month_name_ && !__formatter::__month_name_ok(__value))
- std::__throw_format_error("formatting a month name from an invalid month number");
+ std::__throw_format_error("Formatting a month name from an invalid month number");
if constexpr (__is_hh_mm_ss<_Tp>) {
// Note this is a pedantic intepretation of the Standard. A hh_mm_ss
@@ -544,7 +544,7 @@ __format_chrono(const _Tp& __value,
// - Write it as not valid,
// - or write the number of days.
if (__specs.__chrono_.__hour_ && __value.hours().count() > 23)
- std::__throw_format_error("formatting a hour needs a valid value");
+ std::__throw_format_error("Formatting a hour needs a valid value");
if (__value.is_negative())
__sstr << _CharT('-');
diff --git a/libcxx/include/__chrono/parser_std_format_spec.h b/libcxx/include/__chrono/parser_std_format_spec.h
index b4526ca..296be87 100644
--- a/libcxx/include/__chrono/parser_std_format_spec.h
+++ b/libcxx/include/__chrono/parser_std_format_spec.h
@@ -166,12 +166,12 @@ private:
"undefined behavior by evaluating data not in the input");
if (*__begin != _CharT('%') && *__begin != _CharT('}'))
- std::__throw_format_error("Expected '%' or '}' in the chrono format-string");
+ std::__throw_format_error("The format specifier expects a '%' or a '}'");
do {
switch (*__begin) {
case _CharT('{'):
- std::__throw_format_error("The chrono-specs contains a '{'");
+ std::__throw_format_error("The chrono specifiers contain a '{'");
case _CharT('}'):
return __begin;
@@ -196,7 +196,7 @@ private:
__parse_conversion_spec(_ConstIterator& __begin, _ConstIterator __end, __flags __flags) {
++__begin;
if (__begin == __end)
- std::__throw_format_error("End of input while parsing the modifier chrono conversion-spec");
+ std::__throw_format_error("End of input while parsing a conversion specifier");
switch (*__begin) {
case _CharT('n'):
diff --git a/libcxx/include/__format/format_functions.h b/libcxx/include/__format/format_functions.h
index 8525a57..27ec0a2 100644
--- a/libcxx/include/__format/format_functions.h
+++ b/libcxx/include/__format/format_functions.h
@@ -127,13 +127,13 @@ public:
_LIBCPP_HIDE_FROM_ABI constexpr __arg_t arg(size_t __id) const {
if (__id >= __size_)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
return __args_[__id];
}
_LIBCPP_HIDE_FROM_ABI constexpr const __compile_time_handle<_CharT>& __handle(size_t __id) const {
if (__id >= __size_)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
return __handles_[__id];
}
@@ -256,13 +256,13 @@ __handle_replacement_field(_Iterator __begin, _Iterator __end,
__parse_ctx.advance_to(__r.__last);
break;
default:
- std::__throw_format_error("The replacement field arg-id should terminate at a ':' or '}'");
+ std::__throw_format_error("The argument index should end with a ':' or a '}'");
}
if constexpr (same_as<_Ctx, __compile_time_basic_format_context<_CharT>>) {
__arg_t __type = __ctx.arg(__r.__value);
if (__type == __arg_t::__none)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
else if (__type == __arg_t::__handle)
__ctx.__handle(__r.__value).__parse(__parse_ctx);
else if (__parse)
@@ -271,7 +271,7 @@ __handle_replacement_field(_Iterator __begin, _Iterator __end,
_VSTD::__visit_format_arg(
[&](auto __arg) {
if constexpr (same_as<decltype(__arg), monostate>)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
else if constexpr (same_as<decltype(__arg), typename basic_format_arg<_Ctx>::handle>)
__arg.format(__parse_ctx, __ctx);
else {
diff --git a/libcxx/include/__format/format_string.h b/libcxx/include/__format/format_string.h
index c728cf2..2e1c71b 100644
--- a/libcxx/include/__format/format_string.h
+++ b/libcxx/include/__format/format_string.h
@@ -124,7 +124,7 @@ __parse_number(_Iterator __begin, _Iterator __end_input) {
if (__v > __number_max ||
(__begin != __end_input && *__begin >= _CharT('0') &&
*__begin <= _CharT('9')))
- std::__throw_format_error("The numeric value of the format-spec is too large");
+ std::__throw_format_error("The numeric value of the format specifier is too large");
__value = __v;
}
@@ -154,7 +154,7 @@ __parse_arg_id(_Iterator __begin, _Iterator __end, auto& __parse_ctx) {
return __detail::__parse_automatic(__begin, __end, __parse_ctx);
}
if (*__begin < _CharT('0') || *__begin > _CharT('9'))
- std::__throw_format_error("The arg-id of the format-spec starts with an invalid character");
+ std::__throw_format_error("The argument index starts with an invalid character");
return __detail::__parse_manual(__begin, __end, __parse_ctx);
}
diff --git a/libcxx/include/__format/formatter_tuple.h b/libcxx/include/__format/formatter_tuple.h
index e06f945..030097a 100644
--- a/libcxx/include/__format/formatter_tuple.h
+++ b/libcxx/include/__format/formatter_tuple.h
@@ -60,11 +60,11 @@ struct _LIBCPP_TEMPLATE_VIS __formatter_tuple {
set_brackets({}, {});
++__begin;
} else
- std::__throw_format_error("The format specifier m requires a pair or a two-element tuple");
+ std::__throw_format_error("Type m requires a pair or a tuple with two elements");
}
if (__begin != __end && *__begin != _CharT('}'))
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
__ctx.advance_to(__begin);
diff --git a/libcxx/include/__format/parser_std_format_spec.h b/libcxx/include/__format/parser_std_format_spec.h
index 5147b5e..c01e586 100644
--- a/libcxx/include/__format/parser_std_format_spec.h
+++ b/libcxx/include/__format/parser_std_format_spec.h
@@ -70,12 +70,12 @@ __parse_arg_id(_Iterator __begin, _Iterator __end, _ParseContext& __ctx) {
// This function is a wrapper to call the real parser. But it does the
// validation for the pre-conditions and post-conditions.
if (__begin == __end)
- std::__throw_format_error("End of input while parsing format-spec arg-id");
+ std::__throw_format_error("End of input while parsing an argument index");
__format::__parse_number_result __r = __format::__parse_arg_id(__begin, __end, __ctx);
if (__r.__last == __end || *__r.__last != _CharT('}'))
- std::__throw_format_error("Invalid arg-id");
+ std::__throw_format_error("The argument index is invalid");
++__r.__last;
return __r;
@@ -96,7 +96,7 @@ __substitute_arg_id(basic_format_arg<_Context> __format_arg) {
[](auto __arg) -> uint32_t {
using _Type = decltype(__arg);
if constexpr (same_as<_Type, monostate>)
- std::__throw_format_error("Argument index out of bounds");
+ std::__throw_format_error("The argument index value is too large for the number of arguments supplied");
// [format.string.std]/8
// If { arg-idopt } is used in a width or precision, the value of the
@@ -112,12 +112,12 @@ __substitute_arg_id(basic_format_arg<_Context> __format_arg) {
same_as<_Type, long long> || same_as<_Type, unsigned long long>) {
if constexpr (signed_integral<_Type>) {
if (__arg < 0)
- std::__throw_format_error("A format-spec arg-id replacement shouldn't have a negative value");
+ std::__throw_format_error("An argument index may not have a negative value");
}
using _CT = common_type_t<_Type, decltype(__format::__number_max)>;
if (static_cast<_CT>(__arg) > static_cast<_CT>(__format::__number_max))
- std::__throw_format_error("A format-spec arg-id replacement exceeds the maximum supported value");
+ std::__throw_format_error("The value of the argument index exceeds its maximum value");
return __arg;
} else
@@ -580,9 +580,9 @@ private:
// The forbidden fill characters all code points formed from a single code unit, thus the
// check can be omitted when more code units are used.
if (__use_range_fill && (__fill == _CharT('{') || __fill == _CharT('}') || __fill == _CharT(':')))
- std::__throw_format_error("The format-spec range-fill field contains an invalid character");
+ std::__throw_format_error("The fill option contains an invalid value");
else if (__fill == _CharT('{') || __fill == _CharT('}'))
- std::__throw_format_error("The format-spec fill field contains an invalid character");
+ std::__throw_format_error("The fill option contains an invalid value");
}
# ifndef _LIBCPP_HAS_NO_UNICODE
@@ -599,7 +599,7 @@ private:
__unicode::__code_point_view<_CharT> __view{__begin, __end};
__unicode::__consume_result __consumed = __view.__consume();
if (__consumed.__status != __unicode::__consume_result::__ok)
- std::__throw_format_error("The format-spec contains malformed Unicode characters");
+ std::__throw_format_error("The format specifier contains malformed Unicode characters");
if (__view.__position() < __end && __parse_alignment(*__view.__position())) {
ptrdiff_t __code_units = __view.__position() - __begin;
@@ -630,7 +630,7 @@ private:
"undefined behavior by evaluating data not in the input");
if (__begin + 1 != __end && __parse_alignment(*(__begin + 1))) {
if (!__unicode::__is_scalar_value(*__begin))
- std::__throw_format_error("The fill character contains an invalid value");
+ std::__throw_format_error("The fill option contains an invalid value");
__validate_fill_character(*__begin, __use_range_fill);
@@ -717,7 +717,7 @@ private:
template <contiguous_iterator _Iterator>
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_width(_Iterator& __begin, _Iterator __end, auto& __ctx) {
if (*__begin == _CharT('0'))
- std::__throw_format_error("A format-spec width field shouldn't have a leading zero");
+ std::__throw_format_error("The width option should not have a leading zero");
if (*__begin == _CharT('{')) {
__format::__parse_number_result __r = __format_spec::__parse_arg_id(++__begin, __end, __ctx);
@@ -745,7 +745,7 @@ private:
++__begin;
if (__begin == __end)
- std::__throw_format_error("End of input while parsing format-spec precision");
+ std::__throw_format_error("End of input while parsing format specifier precision");
if (*__begin == _CharT('{')) {
__format::__parse_number_result __arg_id = __format_spec::__parse_arg_id(++__begin, __end, __ctx);
@@ -756,7 +756,7 @@ private:
}
if (*__begin < _CharT('0') || *__begin > _CharT('9'))
- std::__throw_format_error("The format-spec precision field doesn't contain a value or arg-id");
+ std::__throw_format_error("The precision option does not contain a value or an argument index");
__format::__parse_number_result __r = __format::__parse_number(__begin, __end);
__precision_ = __r.__value;
@@ -889,7 +889,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr void __process_display_type_string(__format_spec
break;
default:
- std::__throw_format_error("The format-spec type has a type not supported for a string argument");
+ std::__throw_format_error("The type option contains an invalid value for a string formatting argument");
}
}
diff --git a/libcxx/include/__format/range_formatter.h b/libcxx/include/__format/range_formatter.h
index 30d3a98..2787097 100644
--- a/libcxx/include/__format/range_formatter.h
+++ b/libcxx/include/__format/range_formatter.h
@@ -81,7 +81,7 @@ struct _LIBCPP_TEMPLATE_VIS range_formatter {
// processed by the underlying. For example {:-} for a range in invalid,
// the sign field is not present. Without this check the underlying_ will
// get -} as input which my be valid.
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
__ctx.advance_to(__begin);
__begin = __underlying_.parse(__ctx);
@@ -94,7 +94,7 @@ struct _LIBCPP_TEMPLATE_VIS range_formatter {
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
// could consume more than it should.
if (__begin != __end && *__begin != _CharT('}'))
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
if (__parser_.__type_ != __format_spec::__type::__default) {
// [format.range.formatter]/6
@@ -223,7 +223,7 @@ private:
set_separator(_LIBCPP_STATICALLY_WIDEN(_CharT, ", "));
++__begin;
} else
- std::__throw_format_error("The range-format-spec type m requires two elements for a pair or tuple");
+ std::__throw_format_error("Type m requires a pair or a tuple with two elements");
break;
case _CharT('s'):
@@ -231,18 +231,18 @@ private:
__parser_.__type_ = __format_spec::__type::__string;
++__begin;
} else
- std::__throw_format_error("The range-format-spec type s requires formatting a character type");
+ std::__throw_format_error("Type s requires character type as formatting argument");
break;
case _CharT('?'):
++__begin;
if (__begin == __end || *__begin != _CharT('s'))
- std::__throw_format_error("The format-spec should consume the input or end with a '}'");
+ std::__throw_format_error("The format specifier should consume the input or end with a '}'");
if constexpr (same_as<_Tp, _CharT>) {
__parser_.__type_ = __format_spec::__type::__debug;
++__begin;
} else
- std::__throw_format_error("The range-format-spec type ?s requires formatting a character type");
+ std::__throw_format_error("Type ?s requires character type as formatting argument");
}
}
diff --git a/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h b/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h
index 96a83d2..4eae6ce 100644
--- a/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h
+++ b/libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h
@@ -49,34 +49,34 @@ void test_char_default(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("__['H', 'e', 'l', 'l', 'o']___"), SV("{:_^{}}"), input, 30);
check(SV("#####['H', 'e', 'l', 'l', 'o']"), SV("{:#>{}}"), input, 30);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__'H', 'e', 'l', 'l', 'o'___"), SV("{:_^28n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[H , e , l , l , o ]"), SV("{::4}"), input);
@@ -89,8 +89,8 @@ void test_char_default(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("[_H__, _e__, _l__, _l__, _o__]"), SV("{::_^{}}"), input, 4);
check(SV("[:::H, :::e, :::l, :::l, :::o]"), SV("{:::>{}}"), input, 4);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a character does not allow the sign option", SV("{::-}"), input);
@@ -121,13 +121,15 @@ void test_char_default(TestFunction check, ExceptionTest check_exception, auto&&
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("bBcdoxX?"))
check_exception("The type option contains an invalid value for a character formatting argument", fmt, input);
- // ***** Both have a format-spec
+ // ***** Both have a format specifier
check(SV("^^[:H, :e, :l, :l, :o]^^^"), SV("{:^^25::>2}"), input);
check(SV("^^[:H, :e, :l, :l, :o]^^^"), SV("{:^^{}::>2}"), input, 25);
check(SV("^^[:H, :e, :l, :l, :o]^^^"), SV("{:^^{}::>{}}"), input, 25, 2);
- check_exception("Argument index out of bounds", SV("{:^^{}::>2}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 25);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>2}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 25);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -147,32 +149,32 @@ void test_char_string(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("_Hello__"), SV("{:_^{}s}"), input, 8);
check(SV("###Hello"), SV("{:#>{}s}"), input, 8);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<s}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: s}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#s}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0s}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0s}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.s}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:Ls}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:Ls}"), input);
// *** n
check_exception("The n option and type s can't be used together", SV("{:ns}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
// ***** Only underlying has a format-spec
check_exception("Type s and an underlying format specification can't be used together", SV("{:s:}"), input);
@@ -200,32 +202,32 @@ void test_char_escaped_string(TestFunction check, ExceptionTest check_exception,
check(SV(R"(_"Hello"__)"), SV("{:_^{}?s}"), input, 10);
check(SV(R"(###"Hello")"), SV("{:#>{}?s}"), input, 10);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<?s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<?s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<?s}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-?s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+?s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: ?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: ?s}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#?s}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0?s}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0?s}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.?s}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L?s}"), input);
// *** n
check_exception("The n option and type ?s can't be used together", SV("{:n?s}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
// ***** Only underlying has a format-spec
check_exception("Type ?s and an underlying format specification can't be used together", SV("{:?s:}"), input);
@@ -278,24 +280,20 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
// debug-enabled specialization.
using CharT = wchar_t;
- check_exception("The range-format-spec type s requires formatting a character type",
- SV("{:s}"),
- std::queue{input.begin(), input.end()});
- check_exception("The range-format-spec type s requires formatting a character type",
+ check_exception(
+ "Type s requires character type as formatting argument", SV("{:s}"), std::queue{input.begin(), input.end()});
+ check_exception("Type s requires character type as formatting argument",
SV("{:s}"),
std::priority_queue{input.begin(), input.end()});
- check_exception("The range-format-spec type s requires formatting a character type",
- SV("{:s}"),
- std::stack{input.begin(), input.end()});
- check_exception("The range-format-spec type ?s requires formatting a character type",
- SV("{:?s}"),
- std::queue{input.begin(), input.end()});
- check_exception("The range-format-spec type ?s requires formatting a character type",
+ check_exception(
+ "Type s requires character type as formatting argument", SV("{:s}"), std::stack{input.begin(), input.end()});
+ check_exception(
+ "Type ?s requires character type as formatting argument", SV("{:?s}"), std::queue{input.begin(), input.end()});
+ check_exception("Type ?s requires character type as formatting argument",
SV("{:?s}"),
std::priority_queue{input.begin(), input.end()});
- check_exception("The range-format-spec type ?s requires formatting a character type",
- SV("{:?s}"),
- std::stack{input.begin(), input.end()});
+ check_exception(
+ "Type ?s requires character type as formatting argument", SV("{:?s}"), std::stack{input.begin(), input.end()});
}
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -320,36 +318,36 @@ void test_bool(TestFunction check, ExceptionTest check_exception, auto&& input)
check(SV("__[true, true, false]___"), SV("{:_^{}}"), input, 24);
check(SV("#####[true, true, false]"), SV("{:#>{}}"), input, 24);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__true, true, false___"), SV("{:_^22n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[true , true , false ]"), SV("{::7}"), input);
@@ -362,8 +360,8 @@ void test_bool(TestFunction check, ExceptionTest check_exception, auto&& input)
check(SV("[_true__, _true__, _false_]"), SV("{::_^{}}"), input, 7);
check(SV("[:::true, :::true, ::false]"), SV("{:::>{}}"), input, 7);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a bool does not allow the sign option", SV("{::-}"), input);
@@ -399,8 +397,10 @@ void test_bool(TestFunction check, ExceptionTest check_exception, auto&& input)
check(SV("^^[:::true, :::true, ::false]^^^"), SV("{:^^{}::>7}"), input, 32);
check(SV("^^[:::true, :::true, ::false]^^^"), SV("{:^^{}::>{}}"), input, 32, 7);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 32);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 32);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -432,36 +432,36 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("__[-42, 1, 2, 42]___"), SV("{:_^{}}"), input, 20);
check(SV("#####[-42, 1, 2, 42]"), SV("{:#>{}}"), input, 20);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__-42, 1, 2, 42___"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[ -42, 1, 2, 42]"), SV("{::5}"), input);
@@ -474,8 +474,8 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("[_-42_, __1__, __2__, _42__]"), SV("{::_^{}}"), input, 5);
check(SV("[::-42, ::::1, ::::2, :::42]"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check(SV("[-42, 1, 2, 42]"), SV("{::-}"), input);
@@ -505,8 +505,10 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("^^[::-42, ::::1, ::::2, :::42]^^^"), SV("{:^^{}::>5}"), input, 33);
check(SV("^^[::-42, ::::1, ::::2, :::42]^^^"), SV("{:^^{}::>{}}"), input, 33, 5);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 33);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 33);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -538,36 +540,36 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("__[-42.5, 0, 1.25, 42.5]___"), SV("{:_^{}}"), input, 27);
check(SV("#####[-42.5, 0, 1.25, 42.5]"), SV("{:#>{}}"), input, 27);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__-42.5, 0, 1.25, 42.5___"), SV("{:_^25n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[-42.5, 0, 1.25, 42.5]"), SV("{::5}"), input);
@@ -580,8 +582,8 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("[-42.5, __0__, 1.25_, 42.5_]"), SV("{::_^{}}"), input, 5);
check(SV("[-42.5, ::::0, :1.25, :42.5]"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check(SV("[-42.5, 0, 1.25, 42.5]"), SV("{::-}"), input);
@@ -602,7 +604,7 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("[-42, 0, 1.2, 42]"), SV("{::.{}}"), input, 2);
check(SV("[-42.500, 0.000, 1.250, 42.500]"), SV("{::.{}f}"), input, 3);
- check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+ check_exception("The precision option does not contain a value or an argument index", SV("{::.}"), input);
// *** locale-specific form ***
check(SV("[-42.5, 0, 1.25, 42.5]"), SV("{::L}"), input); // does not require locales present
@@ -633,9 +635,16 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("^^[::-42, ::::0, ::1.2, :::42]^^^"), SV("{:^^{}::>{}.2}"), input, 33, 5);
check(SV("^^[::-42, ::::0, ::1.2, :::42]^^^"), SV("{:^^{}::>{}.{}}"), input, 33, 5, 2);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5.2}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}.2}"), input, 33);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}.{}}"), input, 33, 5);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5.2}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}.2}"), input, 33);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied",
+ SV("{:^^{}::>{}.{}}"),
+ input,
+ 33,
+ 5);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -667,34 +676,34 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("__[0x0]___"), SV("{:_^{}}"), input, 10);
check(SV("#####[0x0]"), SV("{:#>{}}"), input, 10);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("_0x0_"), SV("{:_^5n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[ 0x0]"), SV("{::5}"), input);
@@ -707,8 +716,8 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("[_0x0_]"), SV("{::_^{}}"), input, 5);
check(SV("[::0x0]"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
@@ -740,8 +749,10 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("^^[::0x0]^^^"), SV("{:^^{}::>5}"), input, 12);
check(SV("^^[::0x0]^^^"), SV("{:^^{}::>{}}"), input, 12, 5);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 12);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 12);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -773,34 +784,34 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"(__["Hello", "world"]___)"), SV("{:_^{}}"), input, 23);
check(SV(R"(#####["Hello", "world"])"), SV("{:#>{}}"), input, 23);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV(R"(_"Hello", "world"_)"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV(R"([Hello , world ])"), SV("{::8}"), input);
@@ -813,8 +824,8 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"([_Hello__, _world__])"), SV("{::_^{}}"), input, 8);
check(SV(R"([:::Hello, :::world])"), SV("{:::>{}}"), input, 8);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
@@ -823,21 +834,21 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
check(SV(R"([Hel, wor])"), SV("{::.3}"), input);
check(SV(R"([Hel, wor])"), SV("{::.{}}"), input, 3);
- check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+ check_exception("The precision option does not contain a value or an argument index", SV("{::.}"), input);
// *** locale-specific form ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s?"))
- check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+ check_exception("The type option contains an invalid value for a string formatting argument", fmt, input);
// ***** Both have a format-spec
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^25::>8}"), input);
@@ -848,8 +859,10 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>8}"), input, 25);
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>{}}"), input, 25, 8);
- check_exception("Argument index out of bounds", SV("{:^^{}::>8}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 25);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>8}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 25);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -881,41 +894,41 @@ void test_status(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV("__[0xaaaa, 0x5555, 0xaa55]___"), SV("{:_^{}}"), input, 29);
check(SV("#####[0xaaaa, 0x5555, 0xaa55]"), SV("{:#>{}}"), input, 29);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__0xaaaa, 0x5555, 0xaa55___"), SV("{:_^27n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
- check_exception("The format-spec type has a type not supported for a status argument", SV("{::*<7}"), input);
+ check_exception("The type option contains an invalid value for a status formatting argument", SV("{::*<7}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("sxX"))
- check_exception("The format-spec type has a type not supported for a status argument", fmt, input);
+ check_exception("The type option contains an invalid value for a status formatting argument", fmt, input);
check(SV("[0xaaaa, 0x5555, 0xaa55]"), SV("{::x}"), input);
check(SV("[0XAAAA, 0X5555, 0XAA55]"), SV("{::X}"), input);
@@ -925,7 +938,7 @@ void test_status(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV("^^[0XAAAA, 0X5555, 0XAA55]^^^"), SV("{:^^29:X}"), input);
check(SV("^^[0XAAAA, 0X5555, 0XAA55]^^^"), SV("{:^^{}:X}"), input, 29);
- check_exception("Argument index out of bounds", SV("{:^^{}:X}"), input);
+ check_exception("The argument index value is too large for the number of arguments supplied", SV("{:^^{}:X}"), input);
}
template <class CharT, class TestFunction, class ExceptionTest>
diff --git a/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h b/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h
index d17ddf9..6c6ab0f 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h
+++ b/libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h
@@ -30,37 +30,37 @@ void format_test_vector_bool(TestFunction check, ExceptionTest check_exception,
check(SV("__[true, true, false]___"), SV("{:_^{}}"), input, 24);
check(SV("#####[true, true, false]"), SV("{:#>{}}"), input, 24);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__true, true, false___"), SV("{:_^22n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[true , true , false ]"), SV("{::7}"), input);
@@ -73,8 +73,8 @@ void format_test_vector_bool(TestFunction check, ExceptionTest check_exception,
check(SV("[_true__, _true__, _false_]"), SV("{::_^{}}"), input, 7);
check(SV("[:::true, :::true, ::false]"), SV("{:::>{}}"), input, 7);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a bool does not allow the sign option", SV("{::-}"), input);
@@ -107,8 +107,10 @@ void format_test_vector_bool(TestFunction check, ExceptionTest check_exception,
check(SV("^^[:::true, :::true, ::false]^^^"), SV("{:^^{}::>7}"), input, 32);
check(SV("^^[:::true, :::true, ::false]^^^"), SV("{:^^{}::>{}}"), input, 32, 7);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 32);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 32);
}
template <class CharT, class TestFunction, class ExceptionTest>
diff --git a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h
index 82e7212..898f7ce 100644
--- a/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h
+++ b/libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h
@@ -50,8 +50,8 @@ void format_tests(TestFunction check, ExceptionTest check_exception) {
#endif // !defined(__APPLE__) && !defined(__FreeBSD__)
/***** Test the type generic part *****/
- check_exception("The format-spec fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
// *** sign ***
check_exception("The replacement field misses a terminating '}'", SV("{:-}"), input);
@@ -62,7 +62,7 @@ void format_tests(TestFunction check, ExceptionTest check_exception) {
check_exception("The replacement field misses a terminating '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
check_exception("The replacement field misses a terminating '}'", SV("{:.}"), input);
diff --git a/libcxx/test/std/time/time.syn/formatter.day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
index 95cb30e..e71ac41 100644
--- a/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
@@ -129,14 +129,14 @@ static void test() {
test_valid_values<CharT>();
check_invalid_types<CharT>({SV("d"), SV("e"), SV("Od"), SV("Oe")}, 0d);
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), 0d);
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), 0d);
- check_exception("End of input while parsing the modifier chrono conversion-spec", SV("{:%"), 0d);
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), 0d);
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), 0d);
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), 0d);
check_exception("End of input while parsing the modifier E", SV("{:%E"), 0d);
check_exception("End of input while parsing the modifier O", SV("{:%O"), 0d);
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), 0d);
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), 0d);
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp b/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
index 0ba8abdb..eaf4cb1 100644
--- a/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
@@ -1146,9 +1146,9 @@ static void test() {
SV("R"), SV("S"), SV("t"), SV("T"), SV("X"), SV("EX"), SV("OH"), SV("OI"), SV("OM"), SV("OS")},
0ms);
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), 0ms);
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), 0ms);
- check_exception("End of input while parsing the modifier chrono conversion-spec", SV("{:%"), 0ms);
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), 0ms);
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), 0ms);
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), 0ms);
check_exception("End of input while parsing the modifier E", SV("{:%E"), 0ms);
check_exception("End of input while parsing the modifier O", SV("{:%O"), 0ms);
@@ -1169,7 +1169,7 @@ static void test() {
check(SV("05:42:00"), SV("{:%T}"), std::chrono::years{0xffff}); // 17 bit signed value max
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), 0ms);
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), 0ms);
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
index bde4023..577ac35 100644
--- a/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
@@ -939,14 +939,14 @@ static void test() {
SV("OI"), SV("Om"), SV("OM"), SV("OS"), SV("Ou"), SV("OU"), SV("OV"), SV("Ow"), SV("OW"), SV("Oy"), SV("Oz")},
file_seconds(0s));
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), file_seconds(0s));
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), file_seconds(0s));
- check_exception("End of input while parsing the modifier chrono conversion-spec", SV("{:%"), file_seconds(0s));
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), file_seconds(0s));
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), file_seconds(0s));
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), file_seconds(0s));
check_exception("End of input while parsing the modifier E", SV("{:%E"), file_seconds(0s));
check_exception("End of input while parsing the modifier O", SV("{:%O"), file_seconds(0s));
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), file_seconds(0s));
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), file_seconds(0s));
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp b/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
index c141033..d26408d 100644
--- a/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
@@ -510,20 +510,20 @@ static void test_invalid_values() {
// This looks odd, however the 24 hours is not valid for a 24 hour clock.
// TODO FMT discuss what the "proper" behaviour is.
- check_exception("formatting a hour needs a valid value", SV("{:%H"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%OH"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%I"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%OI"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%H"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%OH"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%I"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%OI"), std::chrono::hh_mm_ss{24h});
check(SV("00"), SV("{:%M}"), std::chrono::hh_mm_ss{24h});
check(SV("00"), SV("{:%OM}"), std::chrono::hh_mm_ss{24h});
check(SV("00"), SV("{:%S}"), std::chrono::hh_mm_ss{24h});
check(SV("00"), SV("{:%OS}"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%p"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%R"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%T"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%r"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%X"), std::chrono::hh_mm_ss{24h});
- check_exception("formatting a hour needs a valid value", SV("{:%EX"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%p"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%R"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%T"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%r"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%X"), std::chrono::hh_mm_ss{24h});
+ check_exception("Formatting a hour needs a valid value", SV("{:%EX"), std::chrono::hh_mm_ss{24h});
}
template <class CharT>
@@ -550,14 +550,13 @@ static void test() {
SV("EX")},
std::chrono::hh_mm_ss{0ms});
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::hh_mm_ss{0ms});
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::hh_mm_ss{0ms});
- check_exception(
- "End of input while parsing the modifier chrono conversion-spec", SV("{:%"), std::chrono::hh_mm_ss{0ms});
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), std::chrono::hh_mm_ss{0ms});
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::hh_mm_ss{0ms});
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), std::chrono::hh_mm_ss{0ms});
check_exception("End of input while parsing the modifier E", SV("{:%E"), std::chrono::hh_mm_ss{0ms});
check_exception("End of input while parsing the modifier O", SV("{:%O"), std::chrono::hh_mm_ss{0ms});
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), std::chrono::hh_mm_ss{0ms});
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), std::chrono::hh_mm_ss{0ms});
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp
index ff92224..692f41e4 100644
--- a/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp
@@ -886,15 +886,14 @@ static void test() {
},
std::chrono::local_seconds(0s));
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::local_seconds(0s));
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::local_seconds(0s));
- check_exception(
- "End of input while parsing the modifier chrono conversion-spec", SV("{:%"), std::chrono::local_seconds(0s));
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), std::chrono::local_seconds(0s));
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::local_seconds(0s));
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), std::chrono::local_seconds(0s));
check_exception("End of input while parsing the modifier E", SV("{:%E"), std::chrono::local_seconds(0s));
check_exception("End of input while parsing the modifier O", SV("{:%O"), std::chrono::local_seconds(0s));
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), std::chrono::local_seconds(0s));
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), std::chrono::local_seconds(0s));
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.month.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month.pass.cpp
index 708d535..de8faeb 100644
--- a/libcxx/test/std/time/time.syn/formatter.month.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.month.pass.cpp
@@ -51,17 +51,17 @@ static void test_no_chrono_specs() {
template <class CharT>
static void test_valid_values() {
// Test that %b, %h, and %B throw an exception.
- check_exception("formatting a month name from an invalid month number", SV("{:%b}"), std::chrono::month{200});
- check_exception("formatting a month name from an invalid month number", SV("{:%b}"), std::chrono::month{13});
- check_exception("formatting a month name from an invalid month number", SV("{:%b}"), std::chrono::month{255});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%b}"), std::chrono::month{200});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%b}"), std::chrono::month{13});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%b}"), std::chrono::month{255});
- check_exception("formatting a month name from an invalid month number", SV("{:%h}"), std::chrono::month{0});
- check_exception("formatting a month name from an invalid month number", SV("{:%h}"), std::chrono::month{13});
- check_exception("formatting a month name from an invalid month number", SV("{:%h}"), std::chrono::month{255});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%h}"), std::chrono::month{0});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%h}"), std::chrono::month{13});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%h}"), std::chrono::month{255});
- check_exception("formatting a month name from an invalid month number", SV("{:%B}"), std::chrono::month{0});
- check_exception("formatting a month name from an invalid month number", SV("{:%B}"), std::chrono::month{13});
- check_exception("formatting a month name from an invalid month number", SV("{:%B}"), std::chrono::month{255});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%B}"), std::chrono::month{0});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%B}"), std::chrono::month{13});
+ check_exception("Formatting a month name from an invalid month number", SV("{:%B}"), std::chrono::month{255});
constexpr std::basic_string_view<CharT> fmt = SV("{:%%b='%b'%t%%B='%B'%t%%h='%h'%t%%m='%m'%t%%Om='%Om'%n}");
constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%b='%b'%t%%B='%B'%t%%h='%h'%t%%m='%m'%t%%Om='%Om'%n}");
@@ -180,14 +180,14 @@ static void test() {
test_valid_values<CharT>();
check_invalid_types<CharT>({SV("b"), SV("B"), SV("h"), SV("m"), SV("Om")}, std::chrono::January);
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::January);
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::January);
- check_exception("End of input while parsing the modifier chrono conversion-spec", SV("{:%"), std::chrono::January);
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), std::chrono::January);
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::January);
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), std::chrono::January);
check_exception("End of input while parsing the modifier E", SV("{:%E"), std::chrono::January);
check_exception("End of input while parsing the modifier O", SV("{:%O"), std::chrono::January);
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), std::chrono::January);
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), std::chrono::January);
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
index 3741367..849de0f 100644
--- a/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
@@ -73,33 +73,33 @@ static void test_no_chrono_specs() {
template <class CharT>
static void test_valid_values() {
// Test that %b, %h, and %B throw an exception.
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_day{std::chrono::month{200}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_day{std::chrono::month{13}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_day{std::chrono::month{255}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_day{std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_day{std::chrono::month{13}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_day{std::chrono::month{255}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_day{std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_day{std::chrono::month{13}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_day{std::chrono::month{255}, std::chrono::day{31}});
@@ -500,13 +500,13 @@ static void test() {
check_invalid_types<CharT>({SV("b"), SV("B"), SV("d"), SV("e"), SV("h"), SV("m"), SV("Od"), SV("Oe"), SV("Om")},
std::chrono::month_day{std::chrono::January, std::chrono::day{31}});
- check_exception("Expected '%' or '}' in the chrono format-string",
+ check_exception("The format specifier expects a '%' or a '}'",
SV("{:A"),
std::chrono::month_day{std::chrono::January, std::chrono::day{31}});
- check_exception("The chrono-specs contains a '{'",
+ check_exception("The chrono specifiers contain a '{'",
SV("{:%%{"),
std::chrono::month_day{std::chrono::January, std::chrono::day{31}});
- check_exception("End of input while parsing the modifier chrono conversion-spec",
+ check_exception("End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::month_day{std::chrono::January, std::chrono::day{31}});
check_exception("End of input while parsing the modifier E",
@@ -517,7 +517,7 @@ static void test() {
std::chrono::month_day{std::chrono::January, std::chrono::day{31}});
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string",
+ check_exception("The format specifier expects a '%' or a '}'",
SV("{:.3}"),
std::chrono::month_day{std::chrono::January, std::chrono::day{31}});
}
diff --git a/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp
index 122de35..7de230914 100644
--- a/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.month_day_last.pass.cpp
@@ -51,33 +51,33 @@ static void test_no_chrono_specs() {
template <class CharT>
static void test_valid_values() {
// Test that %b, %h, and %B throw an exception.
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_day_last{std::chrono::month{200}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_day_last{std::chrono::month{13}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_day_last{std::chrono::month{255}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_day_last{std::chrono::month{0}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_day_last{std::chrono::month{13}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_day_last{std::chrono::month{255}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_day_last{std::chrono::month{0}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_day_last{std::chrono::month{13}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_day_last{std::chrono::month{255}});
@@ -378,9 +378,10 @@ static void test() {
{SV("b"), SV("B"), SV("h"), SV("m"), SV("Om")}, std::chrono::month_day_last{std::chrono::January});
check_exception(
- "Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::month_day_last{std::chrono::January});
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::month_day_last{std::chrono::January});
- check_exception("End of input while parsing the modifier chrono conversion-spec",
+ "The format specifier expects a '%' or a '}'", SV("{:A"), std::chrono::month_day_last{std::chrono::January});
+ check_exception(
+ "The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::month_day_last{std::chrono::January});
+ check_exception("End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::month_day_last{std::chrono::January});
check_exception(
@@ -389,9 +390,8 @@ static void test() {
"End of input while parsing the modifier O", SV("{:%O"), std::chrono::month_day_last{std::chrono::January});
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string",
- SV("{:.3}"),
- std::chrono::month_day_last{std::chrono::January});
+ check_exception(
+ "The format specifier expects a '%' or a '}'", SV("{:.3}"), std::chrono::month_day_last{std::chrono::January});
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp
index 466d514..ef127f0 100644
--- a/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.month_weekday.pass.cpp
@@ -120,59 +120,59 @@ template <class CharT>
static void test_invalid_values() {
// Test that %a, %b, %h, %a, and %B throw an exception.
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::month_weekday{std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{8}, 1}});
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::month_weekday{std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{255}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_weekday{std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_weekday{std::chrono::month{13}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::month_weekday{std::chrono::month{255}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_weekday{std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_weekday{std::chrono::month{13}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::month_weekday{std::chrono::month{255}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::month_weekday{std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{8}, 1}});
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::month_weekday{std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{255}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_weekday{std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_weekday{std::chrono::month{13}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::month_weekday{std::chrono::month{255}, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
}
@@ -685,15 +685,15 @@ static void test() {
std::chrono::month_weekday{std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "Expected '%' or '}' in the chrono format-string",
+ "The format specifier expects a '%' or a '}'",
SV("{:A"),
std::chrono::month_weekday{std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "The chrono-specs contains a '{'",
+ "The chrono specifiers contain a '{'",
SV("{:%%{"),
std::chrono::month_weekday{std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
- "End of input while parsing the modifier chrono conversion-spec",
+ "End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::month_weekday{std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
check_exception(
@@ -707,7 +707,7 @@ static void test() {
// Precision not allowed
check_exception(
- "Expected '%' or '}' in the chrono format-string",
+ "The format specifier expects a '%' or a '}'",
SV("{:.3}"),
std::chrono::month_weekday{std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{0}, 1}});
}
diff --git a/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
index d862610..1c58fe7 100644
--- a/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
@@ -936,15 +936,14 @@ static void test() {
SV("OI"), SV("Om"), SV("OM"), SV("OS"), SV("Ou"), SV("OU"), SV("OV"), SV("Ow"), SV("OW"), SV("Oy"), SV("Oz")},
std::chrono::sys_seconds(0s));
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::sys_seconds(0s));
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::sys_seconds(0s));
- check_exception(
- "End of input while parsing the modifier chrono conversion-spec", SV("{:%"), std::chrono::sys_seconds(0s));
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), std::chrono::sys_seconds(0s));
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::sys_seconds(0s));
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), std::chrono::sys_seconds(0s));
check_exception("End of input while parsing the modifier E", SV("{:%E"), std::chrono::sys_seconds(0s));
check_exception("End of input while parsing the modifier O", SV("{:%O"), std::chrono::sys_seconds(0s));
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), std::chrono::sys_seconds(0s));
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), std::chrono::sys_seconds(0s));
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
index a8571d5..a9213ca 100644
--- a/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
@@ -119,10 +119,10 @@ static void test_valid_values() {
template <class CharT>
static void test_invalid_values() {
// Test that %a and %A throw an exception.
- check_exception("formatting a weekday name needs a valid weekday", SV("{:%a}"), std::chrono::weekday(8));
- check_exception("formatting a weekday name needs a valid weekday", SV("{:%a}"), std::chrono::weekday(255));
- check_exception("formatting a weekday name needs a valid weekday", SV("{:%A}"), std::chrono::weekday(8));
- check_exception("formatting a weekday name needs a valid weekday", SV("{:%A}"), std::chrono::weekday(255));
+ check_exception("Formatting a weekday name needs a valid weekday", SV("{:%a}"), std::chrono::weekday(8));
+ check_exception("Formatting a weekday name needs a valid weekday", SV("{:%a}"), std::chrono::weekday(255));
+ check_exception("Formatting a weekday name needs a valid weekday", SV("{:%A}"), std::chrono::weekday(8));
+ check_exception("Formatting a weekday name needs a valid weekday", SV("{:%A}"), std::chrono::weekday(255));
constexpr std::basic_string_view<CharT> fmt = SV("{:%%u='%u'%t%%Ou='%Ou'%t%%w='%w'%t%%Ow='%Ow'%n}");
constexpr std::basic_string_view<CharT> lfmt = SV("{:L%%u='%u'%t%%Ou='%Ou'%t%%w='%w'%t%%Ow='%Ow'%n}");
@@ -191,14 +191,14 @@ static void test() {
check_invalid_types<CharT>(
{SV("a"), SV("A"), SV("t"), SV("u"), SV("w"), SV("Ou"), SV("Ow")}, std::chrono::weekday(0));
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::weekday(0));
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::weekday(0));
- check_exception("End of input while parsing the modifier chrono conversion-spec", SV("{:%"), std::chrono::weekday(0));
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), std::chrono::weekday(0));
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::weekday(0));
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), std::chrono::weekday(0));
check_exception("End of input while parsing the modifier E", SV("{:%E"), std::chrono::weekday(0));
check_exception("End of input while parsing the modifier O", SV("{:%O"), std::chrono::weekday(0));
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), std::chrono::weekday(0));
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), std::chrono::weekday(0));
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
index 2c014e8..a7f4308 100644
--- a/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
@@ -231,16 +231,16 @@ static void test_valid_values() {
template <class CharT>
static void test_invalid_values() {
// Test that %a and %A throw an exception.
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::weekday_indexed{std::chrono::weekday(8), 1});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::weekday_indexed{std::chrono::weekday(255), 1});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::weekday_indexed{std::chrono::weekday(8), 1});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::weekday_indexed{std::chrono::weekday(255), 1});
@@ -398,12 +398,12 @@ static void test() {
check_invalid_types<CharT>({SV("a"), SV("A"), SV("t"), SV("u"), SV("w"), SV("Ou"), SV("Ow")},
std::chrono::weekday_indexed{std::chrono::weekday(0), 1});
- check_exception("Expected '%' or '}' in the chrono format-string",
+ check_exception("The format specifier expects a '%' or a '}'",
SV("{:A"),
std::chrono::weekday_indexed{std::chrono::weekday(0), 1});
check_exception(
- "The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::weekday_indexed{std::chrono::weekday(0), 1});
- check_exception("End of input while parsing the modifier chrono conversion-spec",
+ "The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::weekday_indexed{std::chrono::weekday(0), 1});
+ check_exception("End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::weekday_indexed{std::chrono::weekday(0), 1});
check_exception("End of input while parsing the modifier E",
@@ -414,7 +414,7 @@ static void test() {
std::chrono::weekday_indexed{std::chrono::weekday(0), 1});
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string",
+ check_exception("The format specifier expects a '%' or a '}'",
SV("{:.3}"),
std::chrono::weekday_indexed{std::chrono::weekday(0), 1});
}
diff --git a/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
index 1790e13..48e6e9d 100644
--- a/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
@@ -214,16 +214,16 @@ static void test_valid_values() {
template <class CharT>
static void test_invalid_values() {
// Test that %a and %A throw an exception.
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::weekday_last{std::chrono::weekday(8)});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::weekday_last{std::chrono::weekday(255)});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::weekday_last{std::chrono::weekday(8)});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::weekday_last{std::chrono::weekday(255)});
@@ -298,9 +298,10 @@ static void test() {
std::chrono::weekday_last{std::chrono::weekday(0)});
check_exception(
- "Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::weekday_last{std::chrono::weekday(0)});
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::weekday_last{std::chrono::weekday(0)});
- check_exception("End of input while parsing the modifier chrono conversion-spec",
+ "The format specifier expects a '%' or a '}'", SV("{:A"), std::chrono::weekday_last{std::chrono::weekday(0)});
+ check_exception(
+ "The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::weekday_last{std::chrono::weekday(0)});
+ check_exception("End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::weekday_last{std::chrono::weekday(0)});
check_exception(
@@ -309,9 +310,8 @@ static void test() {
"End of input while parsing the modifier O", SV("{:%O"), std::chrono::weekday_last{std::chrono::weekday(0)});
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string",
- SV("{:.3}"),
- std::chrono::weekday_last{std::chrono::weekday(0)});
+ check_exception(
+ "The format specifier expects a '%' or a '}'", SV("{:.3}"), std::chrono::weekday_last{std::chrono::weekday(0)});
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.year.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year.pass.cpp
index 2f8bd1d..9cf2836 100644
--- a/libcxx/test/std/time/time.syn/formatter.year.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.year.pass.cpp
@@ -288,14 +288,14 @@ static void test() {
check_invalid_types<CharT>(
{SV("C"), SV("y"), SV("Y"), SV("EC"), SV("Ey"), SV("EY"), SV("Oy")}, std::chrono::year{1970});
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:A"), std::chrono::year{1970});
- check_exception("The chrono-specs contains a '{'", SV("{:%%{"), std::chrono::year{1970});
- check_exception("End of input while parsing the modifier chrono conversion-spec", SV("{:%"), std::chrono::year{1970});
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:A"), std::chrono::year{1970});
+ check_exception("The chrono specifiers contain a '{'", SV("{:%%{"), std::chrono::year{1970});
+ check_exception("End of input while parsing a conversion specifier", SV("{:%"), std::chrono::year{1970});
check_exception("End of input while parsing the modifier E", SV("{:%E"), std::chrono::year{1970});
check_exception("End of input while parsing the modifier O", SV("{:%O"), std::chrono::year{1970});
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string", SV("{:.3}"), std::chrono::year{1970});
+ check_exception("The format specifier expects a '%' or a '}'", SV("{:.3}"), std::chrono::year{1970});
}
int main(int, char**) {
diff --git a/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp
index ac0b76a..d6a4b81 100644
--- a/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.year_month.pass.cpp
@@ -55,11 +55,11 @@ static void test_no_chrono_specs() {
template <class CharT>
static void test_invalid_values() {
// Test that %b and %B throw an exception.
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month{std::chrono::year{1970}, std::chrono::month{0}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month{std::chrono::year{1970}, std::chrono::month{0}});
}
@@ -257,13 +257,13 @@ static void test() {
{SV("b"), SV("B"), SV("C"), SV("EC"), SV("Ey"), SV("EY"), SV("h"), SV("m"), SV("Om"), SV("Oy"), SV("y"), SV("Y")},
std::chrono::year_month{std::chrono::year{1970}, std::chrono::January});
- check_exception("Expected '%' or '}' in the chrono format-string",
+ check_exception("The format specifier expects a '%' or a '}'",
SV("{:A"),
std::chrono::year_month{std::chrono::year{1970}, std::chrono::January});
- check_exception("The chrono-specs contains a '{'",
+ check_exception("The chrono specifiers contain a '{'",
SV("{:%%{"),
std::chrono::year_month{std::chrono::year{1970}, std::chrono::January});
- check_exception("End of input while parsing the modifier chrono conversion-spec",
+ check_exception("End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::year_month{std::chrono::year{1970}, std::chrono::January});
check_exception("End of input while parsing the modifier E",
@@ -274,7 +274,7 @@ static void test() {
std::chrono::year_month{std::chrono::year{1970}, std::chrono::January});
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string",
+ check_exception("The format specifier expects a '%' or a '}'",
SV("{:.3}"),
std::chrono::year_month{std::chrono::year{1970}, std::chrono::January});
}
diff --git a/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
index 7f86e81..aa170f7 100644
--- a/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
@@ -158,254 +158,254 @@ static void test_no_chrono_specs() {
template <class CharT>
static void test_invalid_values() {
// Test that %a, %A, %b, %B, %h, %j, %u, %U, %V, %w, %W, %Ou, %OU, %OV, %Ow, and %OW throw an exception.
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a weekday name needs a valid weekday",
+ check_exception("Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{13}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{255}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{200}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{13}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{255}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{13}, std::chrono::day{31}});
- check_exception("formatting a month name from an invalid month number",
+ check_exception("Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{255}, std::chrono::day{31}});
- check_exception("formatting a day of year needs a valid date",
+ check_exception("Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a day of year needs a valid date",
+ check_exception("Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a day of year needs a valid date",
+ check_exception("Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a day of year needs a valid date",
+ check_exception("Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a day of year needs a valid date",
+ check_exception("Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ou}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ou}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ou}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ou}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ou}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OU}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OU}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OU}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OU}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OU}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OV}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OV}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OV}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OV}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OV}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ow}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ow}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ow}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ow}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a weekday needs a valid weekday",
+ check_exception("Formatting a weekday needs a valid weekday",
SV("{:%Ow}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OW}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{0}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OW}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{1}, std::chrono::day{32}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OW}"),
std::chrono::year_month_day{
std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{29}}); // not a leap year
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OW}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
- check_exception("formatting a week of year needs a valid date",
+ check_exception("Formatting a week of year needs a valid date",
SV("{:%OW}"),
std::chrono::year_month_day{std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::day{31}});
}
@@ -1115,13 +1115,13 @@ static void test() {
SV("u"), SV("U"), SV("V"), SV("w"), SV("W"), SV("x"), SV("y"), SV("Y")},
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{31}});
- check_exception("Expected '%' or '}' in the chrono format-string",
+ check_exception("The format specifier expects a '%' or a '}'",
SV("{:A"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{31}});
- check_exception("The chrono-specs contains a '{'",
+ check_exception("The chrono specifiers contain a '{'",
SV("{:%%{"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{31}});
- check_exception("End of input while parsing the modifier chrono conversion-spec",
+ check_exception("End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{31}});
check_exception("End of input while parsing the modifier E",
@@ -1132,7 +1132,7 @@ static void test() {
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{31}});
// Precision not allowed
- check_exception("Expected '%' or '}' in the chrono format-string",
+ check_exception("The format specifier expects a '%' or a '}'",
SV("{:.3}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{31}});
}
diff --git a/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp
index b2a5b27..7ca0b69 100644
--- a/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.year_month_day_last.pass.cpp
@@ -94,158 +94,158 @@ template <class CharT>
static void test_invalid_values() {
// Test that %a, %A, %b, %B, %h, %j, %u, %U, %V, %w, %W, %Ou, %OU, %OV, %Ow, and %OW throw an exception.
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{13}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{255}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{200}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{13}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{255}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{13}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{255}}});
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%Ou}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%Ou}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%OU}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%OU}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%OV}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%OV}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%Ow}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%Ow}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%OW}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::month{0}}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%OW}"),
std::chrono::year_month_day_last{std::chrono::year{-32768}, std::chrono::month_day_last{std::chrono::month{1}}});
}
@@ -896,15 +896,15 @@ static void test() {
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::January}});
check_exception(
- "Expected '%' or '}' in the chrono format-string",
+ "The format specifier expects a '%' or a '}'",
SV("{:A"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::January}});
check_exception(
- "The chrono-specs contains a '{'",
+ "The chrono specifiers contain a '{'",
SV("{:%%{"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::January}});
check_exception(
- "End of input while parsing the modifier chrono conversion-spec",
+ "End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::January}});
check_exception(
@@ -918,7 +918,7 @@ static void test() {
// Precision not allowed
check_exception(
- "Expected '%' or '}' in the chrono format-string",
+ "The format specifier expects a '%' or a '}'",
SV("{:.3}"),
std::chrono::year_month_day_last{std::chrono::year{1970}, std::chrono::month_day_last{std::chrono::January}});
}
diff --git a/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp
index 26bde11..63e3fc7 100644
--- a/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.year_month_weekday.pass.cpp
@@ -143,127 +143,127 @@ template <class CharT>
static void test_invalid_values() {
// Test that %a, %A, %b, %B, %h, %j, %u, %U, %V, %w, %W, %Ou, %OU, %OV, %Ow, and %OW throw an exception.
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{13}, 1}});
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{13}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 7}});
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{13}, 1}});
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_weekday{
std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{13}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 7}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{13}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%U}"),
std::chrono::year_month_weekday{
std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 7}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{13}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%V}"),
std::chrono::year_month_weekday{
std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{13}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 7}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{13}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "formatting a week of year needs a valid date",
+ "Formatting a week of year needs a valid date",
SV("{:%W}"),
std::chrono::year_month_weekday{
std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
@@ -693,17 +693,17 @@ static void test() {
std::chrono::year{1970}, std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "Expected '%' or '}' in the chrono format-string",
+ "The format specifier expects a '%' or a '}'",
SV("{:A"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "The chrono-specs contains a '{'",
+ "The chrono specifiers contain a '{'",
SV("{:%%{"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
check_exception(
- "End of input while parsing the modifier chrono conversion-spec",
+ "End of input while parsing a conversion specifier",
SV("{:%"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
@@ -720,7 +720,7 @@ static void test() {
// Precision not allowed
check_exception(
- "Expected '%' or '}' in the chrono format-string",
+ "The format specifier expects a '%' or a '}'",
SV("{:.3}"),
std::chrono::year_month_weekday{
std::chrono::year{1970}, std::chrono::January, std::chrono::weekday_indexed{std::chrono::weekday{1}, 1}});
diff --git a/libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp
index 7336924..a9c2b34 100644
--- a/libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.year_month_weekday_last.pass.cpp
@@ -71,41 +71,41 @@ static void test_invalid_values() {
// Weekday name conversion
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%a}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_last{std::chrono::weekday{8}}});
check_exception(
- "formatting a weekday name needs a valid weekday",
+ "Formatting a weekday name needs a valid weekday",
SV("{:%A}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_last{std::chrono::weekday{8}}});
// Weekday conversion
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%u}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_last{std::chrono::weekday{8}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%w}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_last{std::chrono::weekday{8}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%Ou}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_last{std::chrono::weekday{8}}});
check_exception(
- "formatting a weekday needs a valid weekday",
+ "Formatting a weekday needs a valid weekday",
SV("{:%Ow}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_last{std::chrono::weekday{8}}});
// Day of year field
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{1}, std::chrono::weekday_last{std::chrono::weekday{8}}});
@@ -155,24 +155,24 @@ static void test_invalid_values() {
// Day of year field
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_last{std::chrono::weekday{1}}});
// Month name conversion
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%b}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_last{std::chrono::weekday{1}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%h}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_last{std::chrono::weekday{1}}});
check_exception(
- "formatting a month name from an invalid month number",
+ "Formatting a month name from an invalid month number",
SV("{:%B}"),
std::chrono::year_month_weekday_last{
std::chrono::year{1970}, std::chrono::month{0}, std::chrono::weekday_last{std::chrono::weekday{1}}});
@@ -209,7 +209,7 @@ static void test_invalid_values() {
// Day of year field
check_exception(
- "formatting a day of year needs a valid date",
+ "Formatting a day of year needs a valid date",
SV("{:%j}"),
std::chrono::year_month_weekday_last{
std::chrono::year{-32768}, std::chrono::month{1}, std::chrono::weekday_last{std::chrono::weekday{1}}});
diff --git a/libcxx/test/std/utilities/format/format.functions/fill.unicode.pass.cpp b/libcxx/test/std/utilities/format/format.functions/fill.unicode.pass.cpp
index 03546a6..d0a687b 100644
--- a/libcxx/test/std/utilities/format/format.functions/fill.unicode.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.functions/fill.unicode.pass.cpp
@@ -74,53 +74,55 @@ void test() {
// Invalid Unicode Scalar Values
if constexpr (std::same_as<CharT, char>) {
- check_exception("The format-spec contains malformed Unicode characters", SV("{:\xed\xa0\x80^}"), 42); // U+D800
- check_exception("The format-spec contains malformed Unicode characters", SV("{:\xed\xa0\xbf^}"), 42); // U+DBFF
- check_exception("The format-spec contains malformed Unicode characters", SV("{:\xed\xbf\x80^}"), 42); // U+DC00
- check_exception("The format-spec contains malformed Unicode characters", SV("{:\xed\xbf\xbf^}"), 42); // U+DFFF
+ check_exception("The format specifier contains malformed Unicode characters", SV("{:\xed\xa0\x80^}"), 42); // U+D800
+ check_exception("The format specifier contains malformed Unicode characters", SV("{:\xed\xa0\xbf^}"), 42); // U+DBFF
+ check_exception("The format specifier contains malformed Unicode characters", SV("{:\xed\xbf\x80^}"), 42); // U+DC00
+ check_exception("The format specifier contains malformed Unicode characters", SV("{:\xed\xbf\xbf^}"), 42); // U+DFFF
check_exception(
- "The format-spec contains malformed Unicode characters", SV("{:\xf4\x90\x80\x80^}"), 42); // U+110000
+ "The format specifier contains malformed Unicode characters", SV("{:\xf4\x90\x80\x80^}"), 42); // U+110000
check_exception(
- "The format-spec contains malformed Unicode characters", SV("{:\xf4\x90\xbf\xbf^}"), 42); // U+11FFFF
+ "The format specifier contains malformed Unicode characters", SV("{:\xf4\x90\xbf\xbf^}"), 42); // U+11FFFF
- check_exception("The format-spec contains malformed Unicode characters",
+ check_exception("The format specifier contains malformed Unicode characters",
SV("{:\x80^}"),
42); // Trailing code unit with no leading one.
- check_exception(
- "The format-spec contains malformed Unicode characters", SV("{:\xc0^}"), 42); // Missing trailing code unit.
- check_exception(
- "The format-spec contains malformed Unicode characters", SV("{:\xe0\x80^}"), 42); // Missing trailing code unit.
- check_exception("The format-spec contains malformed Unicode characters",
+ check_exception("The format specifier contains malformed Unicode characters",
+ SV("{:\xc0^}"),
+ 42); // Missing trailing code unit.
+ check_exception("The format specifier contains malformed Unicode characters",
+ SV("{:\xe0\x80^}"),
+ 42); // Missing trailing code unit.
+ check_exception("The format specifier contains malformed Unicode characters",
SV("{:\xf0\x80^}"),
42); // Missing two trailing code units.
- check_exception("The format-spec contains malformed Unicode characters",
+ check_exception("The format specifier contains malformed Unicode characters",
SV("{:\xf0\x80\x80^}"),
42); // Missing trailing code unit.
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
} else {
# ifdef TEST_SHORT_WCHAR
- check_exception("The format-spec contains malformed Unicode characters", std::wstring_view{L"{:\xd800^}"}, 42);
- check_exception("The format-spec contains malformed Unicode characters", std::wstring_view{L"{:\xdbff^}"}, 42);
- check_exception("The format-spec contains malformed Unicode characters", std::wstring_view{L"{:\xdc00^}"}, 42);
- check_exception("The format-spec contains malformed Unicode characters", std::wstring_view{L"{:\xddff^}"}, 42);
+ check_exception("The format specifier contains malformed Unicode characters", std::wstring_view{L"{:\xd800^}"}, 42);
+ check_exception("The format specifier contains malformed Unicode characters", std::wstring_view{L"{:\xdbff^}"}, 42);
+ check_exception("The format specifier contains malformed Unicode characters", std::wstring_view{L"{:\xdc00^}"}, 42);
+ check_exception("The format specifier contains malformed Unicode characters", std::wstring_view{L"{:\xddff^}"}, 42);
- check_exception("The format-spec contains malformed Unicode characters",
+ check_exception("The format specifier contains malformed Unicode characters",
std::wstring_view{L"{:\xdc00\xd800^}"},
42); // Reverted surrogates.
# else // TEST_SHORT_WCHAR
- check_exception("The fill character contains an invalid value", std::wstring_view{L"{:\xd800^}"}, 42);
- check_exception("The fill character contains an invalid value", std::wstring_view{L"{:\xdbff^}"}, 42);
- check_exception("The fill character contains an invalid value", std::wstring_view{L"{:\xdc00^}"}, 42);
- check_exception("The fill character contains an invalid value", std::wstring_view{L"{:\xddff^}"}, 42);
+ check_exception("The fill option contains an invalid value", std::wstring_view{L"{:\xd800^}"}, 42);
+ check_exception("The fill option contains an invalid value", std::wstring_view{L"{:\xdbff^}"}, 42);
+ check_exception("The fill option contains an invalid value", std::wstring_view{L"{:\xdc00^}"}, 42);
+ check_exception("The fill option contains an invalid value", std::wstring_view{L"{:\xddff^}"}, 42);
check_exception(
"The format specifier should consume the input or end with a '}'", std::wstring_view{L"{:\xdc00\xd800^}"}, 42);
- check_exception("The fill character contains an invalid value", std::wstring_view{L"{:\x00110000^}"}, 42);
- check_exception("The fill character contains an invalid value", std::wstring_view{L"{:\x0011ffff^}"}, 42);
+ check_exception("The fill option contains an invalid value", std::wstring_view{L"{:\x00110000^}"}, 42);
+ check_exception("The fill option contains an invalid value", std::wstring_view{L"{:\x0011ffff^}"}, 42);
# endif // TEST_SHORT_WCHAR
#endif // TEST_HAS_NO_WIDE_CHARACTERS
}
diff --git a/libcxx/test/std/utilities/format/format.functions/format_tests.h b/libcxx/test/std/utilities/format/format.functions/format_tests.h
index 535d1fb..7a9cdaa 100644
--- a/libcxx/test/std/utilities/format/format.functions/format_tests.h
+++ b/libcxx/test/std/utilities/format/format.functions/format_tests.h
@@ -528,7 +528,7 @@ void format_test_string(const W& world, const U& universe, TestFunction check, E
check_exception("The format specifier should consume the input or end with a '}'", SV("hello {:#}"), world);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("hello {:0}"), world);
+ check_exception("The width option should not have a leading zero", SV("hello {:0}"), world);
// *** width ***
// Width 0 allowed, but not useful for string arguments.
@@ -537,39 +537,39 @@ void format_test_string(const W& world, const U& universe, TestFunction check, E
#ifdef _LIBCPP_VERSION
// This limit isn't specified in the Standard.
static_assert(std::__format::__number_max == 2'147'483'647, "Update the assert and the test.");
- check_exception("The numeric value of the format-spec is too large", SV("{:2147483648}"), world);
- check_exception("The numeric value of the format-spec is too large", SV("{:5000000000}"), world);
- check_exception("The numeric value of the format-spec is too large", SV("{:10000000000}"), world);
+ check_exception("The numeric value of the format specifier is too large", SV("{:2147483648}"), world);
+ check_exception("The numeric value of the format specifier is too large", SV("{:5000000000}"), world);
+ check_exception("The numeric value of the format specifier is too large", SV("{:10000000000}"), world);
#endif
- check_exception("A format-spec arg-id replacement shouldn't have a negative value", SV("hello {:{}}"), world, -1);
- check_exception("A format-spec arg-id replacement exceeds the maximum supported value", SV("hello {:{}}"), world,
- unsigned(-1));
- check_exception("Argument index out of bounds", SV("hello {:{}}"), world);
+ check_exception("An argument index may not have a negative value", SV("hello {:{}}"), world, -1);
+ check_exception("The value of the argument index exceeds its maximum value", SV("hello {:{}}"), world, unsigned(-1));
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("hello {:{}}"), world);
check_exception(
"Replacement argument isn't a standard signed or unsigned integer type", SV("hello {:{}}"), world, universe);
check_exception("Using manual argument numbering in automatic argument numbering mode", SV("hello {:{0}}"), world, 1);
check_exception("Using automatic argument numbering in manual argument numbering mode", SV("hello {0:{}}"), world, 1);
// Arg-id may not have leading zeros.
- check_exception("Invalid arg-id", SV("hello {0:{01}}"), world, 1);
+ check_exception("The argument index is invalid", SV("hello {0:{01}}"), world, 1);
// *** precision ***
#ifdef _LIBCPP_VERSION
// This limit isn't specified in the Standard.
static_assert(std::__format::__number_max == 2'147'483'647, "Update the assert and the test.");
- check_exception("The numeric value of the format-spec is too large", SV("{:.2147483648}"), world);
- check_exception("The numeric value of the format-spec is too large", SV("{:.5000000000}"), world);
- check_exception("The numeric value of the format-spec is too large", SV("{:.10000000000}"), world);
+ check_exception("The numeric value of the format specifier is too large", SV("{:.2147483648}"), world);
+ check_exception("The numeric value of the format specifier is too large", SV("{:.5000000000}"), world);
+ check_exception("The numeric value of the format specifier is too large", SV("{:.10000000000}"), world);
#endif
// Precision 0 allowed, but not useful for string arguments.
check(SV("hello "), SV("hello {:.{}}"), world, 0);
// Precision may have leading zeros. Secondly tests the value is still base 10.
check(SV("hello 0123456789"), SV("hello {:.000010}"), STR("0123456789abcdef"));
- check_exception("A format-spec arg-id replacement shouldn't have a negative value", SV("hello {:.{}}"), world, -1);
- check_exception("A format-spec arg-id replacement exceeds the maximum supported value", SV("hello {:.{}}"), world,
- ~0u);
- check_exception("Argument index out of bounds", SV("hello {:.{}}"), world);
+ check_exception("An argument index may not have a negative value", SV("hello {:.{}}"), world, -1);
+ check_exception("The value of the argument index exceeds its maximum value", SV("hello {:.{}}"), world, ~0u);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("hello {:.{}}"), world);
check_exception(
"Replacement argument isn't a standard signed or unsigned integer type", SV("hello {:.{}}"), world, universe);
check_exception("Using manual argument numbering in automatic argument numbering mode", SV("hello {:.{0}}"), world,
@@ -577,7 +577,7 @@ void format_test_string(const W& world, const U& universe, TestFunction check, E
check_exception("Using automatic argument numbering in manual argument numbering mode", SV("hello {0:.{}}"), world,
1);
// Arg-id may not have leading zeros.
- check_exception("Invalid arg-id", SV("hello {0:.{01}}"), world, 1);
+ check_exception("The argument index is invalid", SV("hello {0:.{01}}"), world, 1);
// *** locale-specific form ***
check_exception("The format specifier should consume the input or end with a '}'", SV("hello {:L}"), world);
@@ -589,7 +589,7 @@ void format_test_string(const W& world, const U& universe, TestFunction check, E
const char* valid_types = "s";
#endif
for (const auto& fmt : invalid_types<CharT>(valid_types))
- check_exception("The format-spec type has a type not supported for a string argument", fmt, world);
+ check_exception("The type option contains an invalid value for a string formatting argument", fmt, world);
}
template <class CharT, class TestFunction>
@@ -978,12 +978,16 @@ void format_test_integer_as_integer(TestFunction check, ExceptionTest check_exce
check_exception("The format specifier should consume the input or end with a '}'", SV("{:.0}"), I(0));
check_exception("The format specifier should consume the input or end with a '}'", SV("{:.42}"), I(0));
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}}"), I(0));
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}}"), I(0), true);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}}"), I(0), 1.0);
+
// *** locale-specific form ***
// See locale-specific_form.pass.cpp
// *** type ***
for (const auto& fmt : invalid_types<CharT>("bBcdoxX"))
- check_exception("The type option contains an invalid value for an integer formatting argument", fmt, 42);
+ check_exception("The type option contains an invalid value for an integer formatting argument", fmt, I(0));
}
template <class I, class CharT, class TestFunction, class ExceptionTest>
@@ -1018,6 +1022,10 @@ void format_test_integer_as_char(TestFunction check, ExceptionTest check_excepti
check_exception("The format specifier should consume the input or end with a '}'", SV("{:.0c}"), I(0));
check_exception("The format specifier should consume the input or end with a '}'", SV("{:.42c}"), I(0));
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}c}"), I(0));
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}c}"), I(0), true);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}c}"), I(0), 1.0);
+
// *** locale-specific form ***
// Note it has no effect but it's allowed.
check(SV("answer is '*'"), SV("answer is '{:Lc}'"), I(42));
@@ -1304,7 +1312,7 @@ void format_test_char_as_integer(TestFunction check, ExceptionTest check_excepti
const char* valid_types = "bBcdoxX";
#endif
for (const auto& fmt : invalid_types<CharT>(valid_types))
- check_exception("The type option contains an invalid value for a character formatting argument", fmt, '*');
+ check_exception("The type option contains an invalid value for a character formatting argument", fmt, CharT('*'));
}
template <class F, class CharT, class TestFunction>
@@ -2964,7 +2972,13 @@ void format_test_pointer(TestFunction check, ExceptionTest check_exception) {
check(SV("answer is '0X0000'"), SV("answer is '{:06P}'"), P(nullptr));
// *** precision ***
- check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), P(nullptr));
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), nullptr);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.0}"), nullptr);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.42}"), nullptr);
+
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}}"), nullptr);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}}"), nullptr, true);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.{}}"), nullptr, 1.0);
// *** locale-specific form ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), P(nullptr));
@@ -2999,7 +3013,7 @@ void format_test_handle(TestFunction check, ExceptionTest check_exception) {
// *** type ***
for (const auto& fmt : invalid_types<CharT>("xXs"))
- check_exception("The format-spec type has a type not supported for a status argument", fmt, status::foo);
+ check_exception("The type option contains an invalid value for a status formatting argument", fmt, status::foo);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -3073,7 +3087,6 @@ void format_test_buffer_optimizations(TestFunction check) {
template <class CharT, execution_modus modus, class TestFunction, class ExceptionTest>
void format_tests(TestFunction check, ExceptionTest check_exception) {
// *** Test escaping ***
-
check(SV("{"), SV("{{"));
check(SV("}"), SV("}}"));
check(SV("{:^}"), SV("{{:^}}"));
@@ -3138,10 +3151,10 @@ void format_tests(TestFunction check, ExceptionTest check_exception) {
check_exception("The format string contains an invalid escape sequence", SV("{:}-}"), 42);
check_exception("The format string contains an invalid escape sequence", SV("} "));
- check_exception("The arg-id of the format-spec starts with an invalid character", SV("{-"), 42);
- check_exception("Argument index out of bounds", SV("hello {}"));
- check_exception("Argument index out of bounds", SV("hello {0}"));
- check_exception("Argument index out of bounds", SV("hello {1}"), 42);
+ check_exception("The argument index starts with an invalid character", SV("{-"), 42);
+ check_exception("The argument index value is too large for the number of arguments supplied", SV("hello {}"));
+ check_exception("The argument index value is too large for the number of arguments supplied", SV("hello {0}"));
+ check_exception("The argument index value is too large for the number of arguments supplied", SV("hello {1}"), 42);
// *** Test char format argument ***
// The `char` to `wchar_t` formatting is tested separately.
@@ -3189,7 +3202,6 @@ void format_tests(TestFunction check, ExceptionTest check_exception) {
format_test_bool<CharT>(check, check_exception);
format_test_bool_as_integer<CharT>(check, check_exception);
}
-
// *** Test signed integral format argument ***
check(SV("hello 42"), SV("hello {}"), static_cast<signed char>(42));
check(SV("hello 42"), SV("hello {}"), static_cast<short>(42));
@@ -3199,6 +3211,7 @@ void format_tests(TestFunction check, ExceptionTest check_exception) {
#ifndef TEST_HAS_NO_INT128
check(SV("hello 42"), SV("hello {}"), static_cast<__int128_t>(42));
#endif
+
if constexpr (modus == execution_modus::full)
format_test_signed_integer<CharT>(check, check_exception);
diff --git a/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h b/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h
index 3aa8953..1e84ebd 100644
--- a/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h
+++ b/libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h
@@ -41,37 +41,37 @@ void test_char(TestFunction check, ExceptionTest check_exception) {
check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^{}}"), input, 35);
check(SV("#####{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{:#>{}}"), input, 35);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__'a': 'A', 'b': 'B', 'c': 'C'___"), SV("{:_^33n}"), input);
// *** type ***
check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^35m}"), input); // the m type does the same as the default.
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
@@ -85,43 +85,45 @@ void test_char(TestFunction check, ExceptionTest check_exception) {
check(SV("{__'a': 'A'___, __'b': 'B'___, __'c': 'C'___}"), SV("{::_^{}}"), input, 13);
check(SV("{#####'a': 'A', #####'b': 'B', #####'c': 'C'}"), SV("{::#>{}}"), input, 13);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{::m}"), input);
check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{::n}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{###'a': 'A', ###'b': 'B', ###'c': 'C'}^^^"), SV("{:^^44:#>11}"), input);
check(SV("^^{###'a': 'A', ###'b': 'B', ###'c': 'C'}^^^"), SV("{:^^{}:#>11}"), input, 44);
check(SV("^^{###'a': 'A', ###'b': 'B', ###'c': 'C'}^^^"), SV("{:^^{}:#>{}}"), input, 44, 11);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>11}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 44);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>11}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 44);
}
//
@@ -149,37 +151,37 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^{}}"), input, 35);
check(SV("#####{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{:#>{}}"), input, 35);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__'a': 'A', 'b': 'B', 'c': 'C'___"), SV("{:_^33n}"), input);
// *** type ***
check(SV("__{'a': 'A', 'b': 'B', 'c': 'C'}___"), SV("{:_^35m}"), input); // the m type does the same as the default.
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{'a': 'A' , 'b': 'B' , 'c': 'C' }"), SV("{::13}"), input);
@@ -192,43 +194,45 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
check(SV("{__'a': 'A'___, __'b': 'B'___, __'c': 'C'___}"), SV("{::_^{}}"), input, 13);
check(SV("{#####'a': 'A', #####'b': 'B', #####'c': 'C'}"), SV("{::#>{}}"), input, 13);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{::m}"), input);
check(SV("{'a': 'A', 'b': 'B', 'c': 'C'}"), SV("{::n}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{###'a': 'A', ###'b': 'B', ###'c': 'C'}^^^"), SV("{:^^44:#>11}"), input);
check(SV("^^{###'a': 'A', ###'b': 'B', ###'c': 'C'}^^^"), SV("{:^^{}:#>11}"), input, 44);
check(SV("^^{###'a': 'A', ###'b': 'B', ###'c': 'C'}^^^"), SV("{:^^{}:#>{}}"), input, 44, 11);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>11}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 44);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>11}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 44);
}
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -255,37 +259,37 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
check(SV("__{false: 0, true: 42, true: 1}___"), SV("{:_^{}}"), input, 34);
check(SV("#####{false: 0, true: 42, true: 1}"), SV("{:#>{}}"), input, 34);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__false: 0, true: 42, true: 1___"), SV("{:_^32n}"), input);
// *** type ***
check(SV("__{false: 0, true: 42, true: 1}___"), SV("{:_^34m}"), input); // the m type does the same as the default.
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{false: 0 , true: 42 , true: 1 }"), SV("{::10}"), input);
@@ -298,38 +302,40 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
check(SV("{_false: 0_, _true: 42_, _true: 1__}"), SV("{::_^{}}"), input, 10);
check(SV("{##false: 0, ##true: 42, ###true: 1}"), SV("{::#>{}}"), input, 10);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>(""))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{##false: 0, ##true: 42, ###true: 1}^^^"), SV("{:^^41:#>10}"), input);
check(SV("^^{##false: 0, ##true: 42, ###true: 1}^^^"), SV("{:^^{}:#>10}"), input, 41);
check(SV("^^{##false: 0, ##true: 42, ###true: 1}^^^"), SV("{:^^{}:#>{}}"), input, 41, 10);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>10}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 41);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>10}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 41);
}
//
@@ -353,37 +359,37 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("__{-42: 42, 1: -1, 42: -42}___"), SV("{:_^{}}"), input, 30);
check(SV("#####{-42: 42, 1: -1, 42: -42}"), SV("{:#>{}}"), input, 30);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__-42: 42, 1: -1, 42: -42___"), SV("{:_^28n}"), input);
// *** type ***
check(SV("__{-42: 42, 1: -1, 42: -42}___"), SV("{:_^30m}"), input); // the m type does the same as the default.
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{-42: 42 , 1: -1 , 42: -42 }"), SV("{::10}"), input);
@@ -396,38 +402,40 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("{_-42: 42__, __1: -1___, _42: -42__}"), SV("{::_^{}}"), input, 10);
check(SV("{###-42: 42, #####1: -1, ###42: -42}"), SV("{::#>{}}"), input, 10);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>(""))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{###-42: 42, #####1: -1, ###42: -42}^^^"), SV("{:^^41:#>10}"), input);
check(SV("^^{###-42: 42, #####1: -1, ###42: -42}^^^"), SV("{:^^{}:#>10}"), input, 41);
check(SV("^^{###-42: 42, #####1: -1, ###42: -42}^^^"), SV("{:^^{}:#>{}}"), input, 41, 10);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>10}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 41);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>10}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 41);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -458,37 +466,37 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception) {
check(SV("__{-42: 42, 1: -1}___"), SV("{:_^{}}"), input, 21);
check(SV("#####{-42: 42, 1: -1}"), SV("{:#>{}}"), input, 21);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__-42: 42, 1: -1___"), SV("{:_^19n}"), input);
// *** type ***
check(SV("__{-42: 42, 1: -1}___"), SV("{:_^21m}"), input); // the m type does the same as the default.
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{-42: 42 , 1: -1 }"), SV("{::10}"), input);
@@ -501,38 +509,40 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception) {
check(SV("{_-42: 42__, __1: -1___}"), SV("{::_^{}}"), input, 10);
check(SV("{###-42: 42, #####1: -1}"), SV("{::#>{}}"), input, 10);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>(""))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{###-42: 42, #####1: -1}^^^"), SV("{:^^29:#>10}"), input);
check(SV("^^{###-42: 42, #####1: -1}^^^"), SV("{:^^{}:#>10}"), input, 29);
check(SV("^^{###-42: 42, #####1: -1}^^^"), SV("{:^^{}:#>{}}"), input, 29, 10);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>10}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 29);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>10}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 29);
}
//
@@ -558,35 +568,35 @@ void test_pointer(TestFunction check, ExceptionTest check_exception) {
check(SV("__{0x0: 0x0}___"), SV("{:_^{}}"), input, 15);
check(SV("#####{0x0: 0x0}"), SV("{:#>{}}"), input, 15);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__0x0: 0x0___"), SV("{:_^13n}"), input);
// *** type ***
check(SV("__{0x0: 0x0}___"), SV("{:_^15m}"), input); // the m type does the same as the default.
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{0x0: 0x0 }"), SV("{::13}"), input);
@@ -599,38 +609,40 @@ void test_pointer(TestFunction check, ExceptionTest check_exception) {
check(SV("{__0x0: 0x0___}"), SV("{::_^{}}"), input, 13);
check(SV("{#####0x0: 0x0}"), SV("{::#>{}}"), input, 13);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>(""))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{###0x0: 0x0}^^^"), SV("{:^^18:#>11}"), input);
check(SV("^^{###0x0: 0x0}^^^"), SV("{:^^{}:#>11}"), input, 18);
check(SV("^^{###0x0: 0x0}^^^"), SV("{:^^{}:#>{}}"), input, 18, 11);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>11}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 18);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>11}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 18);
}
//
@@ -657,35 +669,35 @@ void test_string(TestFunction check, ExceptionTest check_exception) {
check(SV(R"(__{"hello": "HELLO", "world": "WORLD"}___)"), SV("{:_^{}}"), input, 41);
check(SV(R"(#####{"hello": "HELLO", "world": "WORLD"})"), SV("{:#>{}}"), input, 41);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV(R"(__"hello": "HELLO", "world": "WORLD"___)"), SV("{:_^39n}"), input);
// *** type ***
check(SV(R"(__{"hello": "HELLO", "world": "WORLD"}___)"), SV("{:_^41m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV(R"({"hello": "HELLO" , "world": "WORLD" })"), SV("{::21}"), input);
@@ -698,30 +710,30 @@ void test_string(TestFunction check, ExceptionTest check_exception) {
check(SV(R"({__"hello": "HELLO"___, __"world": "WORLD"___})"), SV("{::_^{}}"), input, 21);
check(SV(R"({#####"hello": "HELLO", #####"world": "WORLD"})"), SV("{::#>{}}"), input, 21);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>(""))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
@@ -729,8 +741,10 @@ void test_string(TestFunction check, ExceptionTest check_exception) {
check(SV(R"(^^{#####"hello": "HELLO", #####"world": "WORLD"}^^^)"), SV("{:^^{}:#>21}"), input, 51);
check(SV(R"(^^{#####"hello": "HELLO", #####"world": "WORLD"}^^^)"), SV("{:^^{}:#>{}}"), input, 51, 21);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>21}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 51);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>21}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 51);
}
//
@@ -756,34 +770,34 @@ void test_status(TestFunction check, ExceptionTest check_exception) {
check(SV("__{0xaa55: 0xaaaa, 0xaa55: 0x5555}___"), SV("{:_^{}}"), input, 37);
check(SV("#####{0xaa55: 0xaaaa, 0xaa55: 0x5555}"), SV("{:#>{}}"), input, 37);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__0xaa55: 0xaaaa, 0xaa55: 0x5555___"), SV("{:_^35n}"), input);
// *** type ***
check(SV("__{0xaa55: 0xaaaa, 0xaa55: 0x5555}___"), SV("{:_^37}"), input); // the m type does the same as the default.
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
// Underlying can't have a format-spec
}
diff --git a/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h b/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h
index adafa12..44a5dbd 100644
--- a/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h
+++ b/libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h
@@ -48,32 +48,32 @@ void test_char_default(TestFunction check, ExceptionTest check_exception) {
check(SV("__{'a', 'b', 'c'}___"), SV("{:_^{}}"), input, 20);
check(SV("#####{'a', 'b', 'c'}"), SV("{:#>{}}"), input, 20);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__'a', 'b', 'c'___"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
// ***** Only underlying has a format-spec
check(SV("{a , b , c }"), SV("{::4}"), input);
@@ -86,8 +86,8 @@ void test_char_default(TestFunction check, ExceptionTest check_exception) {
check(SV("{_a__, _b__, _c__}"), SV("{::_^{}}"), input, 4);
check(SV("{:::a, :::b, :::c}"), SV("{:::>{}}"), input, 4);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a character does not allow the sign option", SV("{::-}"), input);
@@ -123,8 +123,10 @@ void test_char_default(TestFunction check, ExceptionTest check_exception) {
check(SV("^^{:a, :b, :c}^^^"), SV("{:^^{}::>2}"), input, 17);
check(SV("^^{:a, :b, :c}^^^"), SV("{:^^{}::>{}}"), input, 17, 2);
- check_exception("Argument index out of bounds", SV("{:^^{}::>2}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 17);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>2}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 17);
}
// A set can be written as a string, based on
@@ -150,32 +152,32 @@ void test_char_string(TestFunction check, [[maybe_unused]] ExceptionTest check_e
check(SV("_abc__"), SV("{:_^{}s}"), input, 6);
check(SV("###abc"), SV("{:#>{}s}"), input, 6);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<s}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: s}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#s}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0s}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0s}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.s}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:Ls}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:Ls}"), input);
// *** n
check_exception("The n option and type s can't be used together", SV("{:ns}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
// ***** Only underlying has a format-spec
check_exception("Type s and an underlying format specification can't be used together", SV("{:s:}"), input);
@@ -209,32 +211,32 @@ void test_char_escaped_string(TestFunction check, [[maybe_unused]] ExceptionTest
check(SV(R"(_"abc"__)"), SV("{:_^{}?s}"), input, 8);
check(SV(R"(###"abc")"), SV("{:#>{}?s}"), input, 8);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<?s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<?s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<?s}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-?s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+?s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: ?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: ?s}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#?s}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0?s}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0?s}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.?s}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L?s}"), input);
// *** n
check_exception("The n option and type ?s can't be used together", SV("{:n?s}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
// ***** Only underlying has a format-spec
check_exception("Type ?s and an underlying format specification can't be used together", SV("{:?s:}"), input);
@@ -281,32 +283,32 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
check(SV("__{'a', 'b', 'c'}___"), SV("{:_^{}}"), input, 20);
check(SV("#####{'a', 'b', 'c'}"), SV("{:#>{}}"), input, 20);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__'a', 'b', 'c'___"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
// ***** Only underlying has a format-spec
check(SV("{a , b , c }"), SV("{::4}"), input);
@@ -319,8 +321,8 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
check(SV("{_a__, _b__, _c__}"), SV("{::_^{}}"), input, 4);
check(SV("{:::a, :::b, :::c}"), SV("{:::>{}}"), input, 4);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a character does not allow the sign option", SV("{::-}"), input);
@@ -356,8 +358,10 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
check(SV("^^{:a, :b, :c}^^^"), SV("{:^^{}::>2}"), input, 17);
check(SV("^^{:a, :b, :c}^^^"), SV("{:^^{}::>{}}"), input, 17, 2);
- check_exception("Argument index out of bounds", SV("{:^^{}::>2}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 17);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>2}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 17);
// The types s and ?s may only be used when using range_formatter<T, charT>
// where the types T and charT are the same. This means this can't be used for
@@ -365,8 +369,8 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
// debug-enabled specialization.
using CharT = wchar_t;
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
}
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
@@ -393,37 +397,37 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
check(SV("__{false, true}___"), SV("{:_^{}}"), input, 18);
check(SV("#####{false, true}"), SV("{:#>{}}"), input, 18);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__false, true___"), SV("{:_^16n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{false , true }"), SV("{::7}"), input);
@@ -436,8 +440,8 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
check(SV("{_false_, _true__}"), SV("{::_^{}}"), input, 7);
check(SV("{::false, :::true}"), SV("{:::>{}}"), input, 7);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a bool does not allow the sign option", SV("{::-}"), input);
@@ -473,8 +477,10 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
check(SV("^^{::false, :::true}^^^"), SV("{:^^{}::>7}"), input, 23);
check(SV("^^{::false, :::true}^^^"), SV("{:^^{}::>{}}"), input, 23, 7);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 23);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 23);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -496,37 +502,37 @@ void test_bool_multiset(TestFunction check, ExceptionTest check_exception) {
check(SV("__{true, true, false}___"), SV("{:_^{}}"), input, 24);
check(SV("#####{true, true, false}"), SV("{:#>{}}"), input, 24);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__true, true, false___"), SV("{:_^22n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{true , true , false }"), SV("{::7}"), input);
@@ -539,8 +545,8 @@ void test_bool_multiset(TestFunction check, ExceptionTest check_exception) {
check(SV("{_true__, _true__, _false_}"), SV("{::_^{}}"), input, 7);
check(SV("{:::true, :::true, ::false}"), SV("{:::>{}}"), input, 7);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a bool does not allow the sign option", SV("{::-}"), input);
@@ -576,8 +582,10 @@ void test_bool_multiset(TestFunction check, ExceptionTest check_exception) {
check(SV("^^{:::true, :::true, ::false}^^^"), SV("{:^^{}::>7}"), input, 32);
check(SV("^^{:::true, :::true, ::false}^^^"), SV("{:^^{}::>{}}"), input, 32, 7);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 32);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 32);
}
//
@@ -601,37 +609,37 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("__{-42, 1, 2, 42}___"), SV("{:_^{}}"), input, 20);
check(SV("#####{-42, 1, 2, 42}"), SV("{:#>{}}"), input, 20);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__-42, 1, 2, 42___"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{ -42, 1, 2, 42}"), SV("{::5}"), input);
@@ -644,8 +652,8 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("{_-42_, __1__, __2__, _42__}"), SV("{::_^{}}"), input, 5);
check(SV("{::-42, ::::1, ::::2, :::42}"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check(SV("{-42, 1, 2, 42}"), SV("{::-}"), input);
@@ -675,8 +683,10 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("^^{::-42, ::::1, ::::2, :::42}^^^"), SV("{:^^{}::>5}"), input, 33);
check(SV("^^{::-42, ::::1, ::::2, :::42}^^^"), SV("{:^^{}::>{}}"), input, 33, 5);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 33);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 33);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -706,37 +716,37 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("__{-42.5, 0, 1.25, 42.5}___"), SV("{:_^{}}"), input, 27);
check(SV("#####{-42.5, 0, 1.25, 42.5}"), SV("{:#>{}}"), input, 27);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__-42.5, 0, 1.25, 42.5___"), SV("{:_^25n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{-42.5, 0, 1.25, 42.5}"), SV("{::5}"), input);
@@ -749,8 +759,8 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("{-42.5, __0__, 1.25_, 42.5_}"), SV("{::_^{}}"), input, 5);
check(SV("{-42.5, ::::0, :1.25, :42.5}"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check(SV("{-42.5, 0, 1.25, 42.5}"), SV("{::-}"), input);
@@ -771,7 +781,7 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("{-42, 0, 1.2, 42}"), SV("{::.{}}"), input, 2);
check(SV("{-42.500, 0.000, 1.250, 42.500}"), SV("{::.{}f}"), input, 3);
- check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+ check_exception("The precision option does not contain a value or an argument index", SV("{::.}"), input);
// *** locale-specific form ***
check(SV("{-42.5, 0, 1.25, 42.5}"), SV("{::L}"), input); // does not require locales present
@@ -802,9 +812,16 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("^^{::-42, ::::0, ::1.2, :::42}^^^"), SV("{:^^{}::>{}.2}"), input, 33, 5);
check(SV("^^{::-42, ::::0, ::1.2, :::42}^^^"), SV("{:^^{}::>{}.{}}"), input, 33, 5, 2);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5.2}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}.2}"), input, 33);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}.{}}"), input, 33, 5);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5.2}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}.2}"), input, 33);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied",
+ SV("{:^^{}::>{}.{}}"),
+ input,
+ 33,
+ 5);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -835,35 +852,35 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("__{0x0}___"), SV("{:_^{}}"), input, 10);
check(SV("#####{0x0}"), SV("{:#>{}}"), input, 10);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("_0x0_"), SV("{:_^5n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{ 0x0}"), SV("{::5}"), input);
@@ -876,8 +893,8 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("{_0x0_}"), SV("{::_^{}}"), input, 5);
check(SV("{::0x0}"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
@@ -909,8 +926,10 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("^^{::0x0}^^^"), SV("{:^^{}::>5}"), input, 12);
check(SV("^^{::0x0}^^^"), SV("{:^^{}::>{}}"), input, 12, 5);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 12);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 12);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -941,35 +960,35 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"(__{"Hello", "world"}___)"), SV("{:_^{}}"), input, 23);
check(SV(R"(#####{"Hello", "world"})"), SV("{:#>{}}"), input, 23);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV(R"(_"Hello", "world"_)"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV(R"({Hello , world })"), SV("{::8}"), input);
@@ -982,8 +1001,8 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"({_Hello__, _world__})"), SV("{::_^{}}"), input, 8);
check(SV(R"({:::Hello, :::world})"), SV("{:::>{}}"), input, 8);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
@@ -992,21 +1011,21 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
check(SV(R"({Hel, wor})"), SV("{::.3}"), input);
check(SV(R"({Hel, wor})"), SV("{::.{}}"), input, 3);
- check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+ check_exception("The precision option does not contain a value or an argument index", SV("{::.}"), input);
// *** locale-specific form ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s?"))
- check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+ check_exception("The type option contains an invalid value for a string formatting argument", fmt, input);
// ***** Both have a format-spec
check(SV(R"(^^{:::Hello, :::world}^^^)"), SV("{:^^25::>8}"), input);
@@ -1017,8 +1036,10 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"(^^{:::Hello, :::world}^^^)"), SV("{:^^{}::>8}"), input, 25);
check(SV(R"(^^{:::Hello, :::world}^^^)"), SV("{:^^{}::>{}}"), input, 25, 8);
- check_exception("Argument index out of bounds", SV("{:^^{}::>8}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 25);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>8}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 25);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -1050,40 +1071,40 @@ void test_status(TestFunction check, ExceptionTest check_exception) {
check(SV("__{0x5555, 0xaa55, 0xaaaa}___"), SV("{:_^{}}"), input, 29);
check(SV("#####{0x5555, 0xaa55, 0xaaaa}"), SV("{:#>{}}"), input, 29);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__0x5555, 0xaa55, 0xaaaa___"), SV("{:_^27n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
- check_exception("The format-spec type has a type not supported for a status argument", SV("{::*<7}"), input);
+ check_exception("The type option contains an invalid value for a status formatting argument", SV("{::*<7}"), input);
check(SV("{0x5555, 0xaa55, 0xaaaa}"), SV("{::x}"), input);
check(SV("{0X5555, 0XAA55, 0XAAAA}"), SV("{::X}"), input);
@@ -1093,7 +1114,7 @@ void test_status(TestFunction check, ExceptionTest check_exception) {
check(SV("^^{0X5555, 0XAA55, 0XAAAA}^^^"), SV("{:^^29:X}"), input);
check(SV("^^{0X5555, 0XAA55, 0XAAAA}^^^"), SV("{:^^{}:X}"), input, 29);
- check_exception("Argument index out of bounds", SV("{:^^{}:X}"), input);
+ check_exception("The argument index value is too large for the number of arguments supplied", SV("{:^^{}:X}"), input);
}
//
@@ -1117,26 +1138,26 @@ void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& i
check(SV("__{(1, 'a'), (42, '*')}___"), SV("{:_^{}}"), input, 26);
check(SV("#####{(1, 'a'), (42, '*')}"), SV("{:#>{}}"), input, 26);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__(1, 'a'), (42, '*')___"), SV("{:_^24n}"), input);
@@ -1144,11 +1165,11 @@ void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& i
// *** type ***
check(SV("__{(1, 'a'), (42, '*')}___"), SV("{:_^26m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{(1, 'a') , (42, '*') }"), SV("{::11}"), input);
@@ -1161,35 +1182,35 @@ void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& i
check(SV("{_(1, 'a')__, _(42, '*')_}"), SV("{::_^{}}"), input, 11);
check(SV("{###(1, 'a'), ##(42, '*')}"), SV("{::#>{}}"), input, 11);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
check(SV("{1: 'a', 42: '*'}"), SV("{::m}"), input);
check(SV("{1, 'a', 42, '*'}"), SV("{::n}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{###(1, 'a'), ##(42, '*')}^^^"), SV("{:^^31:#>11}"), input);
@@ -1197,8 +1218,10 @@ void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& i
check(SV("^^{###(1, 'a'), ##(42, '*')}^^^"), SV("{:^^{}:#>11}"), input, 31);
check(SV("^^{###(1, 'a'), ##(42, '*')}^^^"), SV("{:^^{}:#>{}}"), input, 31, 11);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 31);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 31);
check(SV("1: 'a', 42: '*'"), SV("{:n:m}"), input);
check(SV("1, 'a', 42, '*'"), SV("{:n:n}"), input);
@@ -1237,37 +1260,37 @@ void test_tuple_int(TestFunction check, ExceptionTest check_exception) {
check(SV("__{(42), (99)}___"), SV("{:_^{}}"), input, 17);
check(SV("#####{(42), (99)}"), SV("{:#>{}}"), input, 17);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__(42), (99)___"), SV("{:_^15n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{(42) , (99) }"), SV("{::7}"), input);
@@ -1280,35 +1303,35 @@ void test_tuple_int(TestFunction check, ExceptionTest check_exception) {
check(SV("{_(42)__, _(99)__}"), SV("{::_^{}}"), input, 7);
check(SV("{###(42), ###(99)}"), SV("{::#>{}}"), input, 7);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
check(SV("{42, 99}"), SV("{::n}"), input);
- check_exception("The format specifier m requires a pair or a two-element tuple", SV("{::m}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{::m}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{###(42), ###(99)}^^^"), SV("{:^^23:#>7}"), input);
@@ -1316,8 +1339,10 @@ void test_tuple_int(TestFunction check, ExceptionTest check_exception) {
check(SV("^^{###(42), ###(99)}^^^"), SV("{:^^{}:#>7}"), input, 23);
check(SV("^^{###(42), ###(99)}^^^"), SV("{:^^{}:#>{}}"), input, 23, 7);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 23);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 23);
}
//
@@ -1343,37 +1368,37 @@ void test_tuple_int_int_int(TestFunction check, ExceptionTest check_exception) {
check(SV("__{(1, 10, 100), (42, 99, 0)}___"), SV("{:_^{}}"), input, 32);
check(SV("#####{(1, 10, 100), (42, 99, 0)}"), SV("{:#>{}}"), input, 32);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__(1, 10, 100), (42, 99, 0)___"), SV("{:_^30n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("{(1, 10, 100) , (42, 99, 0) }"), SV("{::14}"), input);
@@ -1386,35 +1411,35 @@ void test_tuple_int_int_int(TestFunction check, ExceptionTest check_exception) {
check(SV("{_(1, 10, 100)_, _(42, 99, 0)__}"), SV("{::_^{}}"), input, 14);
check(SV("{##(1, 10, 100), ###(42, 99, 0)}"), SV("{::#>{}}"), input, 14);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
check(SV("{1, 10, 100, 42, 99, 0}"), SV("{::n}"), input);
- check_exception("The format specifier m requires a pair or a two-element tuple", SV("{::m}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{::m}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^{##(1, 10, 100), ###(42, 99, 0)}^^^"), SV("{:^^37:#>14}"), input);
@@ -1422,8 +1447,10 @@ void test_tuple_int_int_int(TestFunction check, ExceptionTest check_exception) {
check(SV("^^{##(1, 10, 100), ###(42, 99, 0)}^^^"), SV("{:^^{}:#>14}"), input, 37);
check(SV("^^{##(1, 10, 100), ###(42, 99, 0)}^^^"), SV("{:^^{}:#>{}}"), input, 37, 14);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 37);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 37);
}
//
diff --git a/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h b/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h
index 9e70f8f..623af1d 100644
--- a/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h
+++ b/libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h
@@ -71,8 +71,8 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV("__hello___"), SV("{:_^{}}"), input, 10);
check(SV(":::::hello"), SV("{::>{}}"), input, 10);
- check_exception("The format-spec fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
@@ -81,7 +81,7 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
check(SV("hel"), SV("{:.3}"), input);
@@ -97,7 +97,7 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV("hello"), SV("{:s}"), input);
check(SV("\"hello\""), SV("{:?}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s?"))
- check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+ check_exception("The type option contains an invalid value for a string formatting argument", fmt, input);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -131,35 +131,35 @@ void test_range_string(TestFunction check, ExceptionTest check_exception, auto&&
check(SV(R"(__[Hello, world]___)"), SV("{:_^{}}"), input, 19);
check(SV(R"(#####[Hello, world])"), SV("{:#>{}}"), input, 19);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV(R"(_Hello, world_)"), SV("{:_^14n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV(R"([Hello , world ])"), SV("{::8}"), input);
@@ -172,8 +172,8 @@ void test_range_string(TestFunction check, ExceptionTest check_exception, auto&&
check(SV(R"([_Hello__, _world__])"), SV("{::_^{}}"), input, 8);
check(SV(R"([:::Hello, :::world])"), SV("{:::>{}}"), input, 8);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
@@ -182,21 +182,21 @@ void test_range_string(TestFunction check, ExceptionTest check_exception, auto&&
check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
check(SV(R"([Hel, wor])"), SV("{::.3}"), input);
check(SV(R"([Hel, wor])"), SV("{::.{}}"), input, 3);
- check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+ check_exception("The precision option does not contain a value or an argument index", SV("{::.}"), input);
// *** locale-specific form ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s?"))
- check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+ check_exception("The type option contains an invalid value for a string formatting argument", fmt, input);
// ***** Both have a format-spec
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^25::>8}"), input);
@@ -207,8 +207,10 @@ void test_range_string(TestFunction check, ExceptionTest check_exception, auto&&
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>8}"), input, 25);
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>{}}"), input, 25, 8);
- check_exception("Argument index out of bounds", SV("{:^^{}::>8}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 25);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>8}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 25);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -256,8 +258,8 @@ void test_debug_string(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("__\"hello\"___"), SV("{:_^{}}"), input, 12);
check(SV(":::::\"hello\""), SV("{::>{}}"), input, 12);
- check_exception("The format-spec fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
@@ -266,7 +268,7 @@ void test_debug_string(TestFunction check, ExceptionTest check_exception, auto&&
check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
check(SV("\"he"), SV("{:.3}"), input);
@@ -282,7 +284,7 @@ void test_debug_string(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("\"hello\""), SV("{:s}"), input); // escape overrides the type option s
check(SV("\"hello\""), SV("{:?}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s?"))
- check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+ check_exception("The type option contains an invalid value for a string formatting argument", fmt, input);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -317,35 +319,35 @@ void test_range_debug_string(TestFunction check, ExceptionTest check_exception,
check(SV(R"(__["Hello", "world"]___)"), SV("{:_^{}}"), input, 23);
check(SV(R"(#####["Hello", "world"])"), SV("{:#>{}}"), input, 23);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV(R"(_"Hello", "world"_)"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV(R"(["Hello" , "world" ])"), SV("{::10}"), input);
@@ -358,8 +360,8 @@ void test_range_debug_string(TestFunction check, ExceptionTest check_exception,
check(SV(R"([_"Hello"__, _"world"__])"), SV("{::_^{}}"), input, 10);
check(SV(R"([:::"Hello", :::"world"])"), SV("{:::>{}}"), input, 10);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
@@ -368,21 +370,21 @@ void test_range_debug_string(TestFunction check, ExceptionTest check_exception,
check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
check(SV(R"(["He, "wo])"), SV("{::.3}"), input);
check(SV(R"(["He, "wo])"), SV("{::.{}}"), input, 3);
- check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+ check_exception("The precision option does not contain a value or an argument index", SV("{::.}"), input);
// *** locale-specific form ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s?"))
- check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+ check_exception("The type option contains an invalid value for a string formatting argument", fmt, input);
// ***** Both have a format-spec
check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^29::>10}"), input);
@@ -393,8 +395,10 @@ void test_range_debug_string(TestFunction check, ExceptionTest check_exception,
check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^{}::>10}"), input, 29);
check(SV(R"(^^[:::"Hello", :::"world"]^^^)"), SV("{:^^{}::>{}}"), input, 29, 10);
- check_exception("Argument index out of bounds", SV("{:^^{}::>10}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 29);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>10}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 29);
}
template <class CharT, class TestFunction, class ExceptionTest>
diff --git a/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h b/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
index 953948f..1e6c75c 100644
--- a/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
+++ b/libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
@@ -53,34 +53,34 @@ void test_char_default(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("__['H', 'e', 'l', 'l', 'o']___"), SV("{:_^{}}"), input, 30);
check(SV("#####['H', 'e', 'l', 'l', 'o']"), SV("{:#>{}}"), input, 30);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__'H', 'e', 'l', 'l', 'o'___"), SV("{:_^28n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[H , e , l , l , o ]"), SV("{::4}"), input);
@@ -93,8 +93,8 @@ void test_char_default(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("[_H__, _e__, _l__, _l__, _o__]"), SV("{::_^{}}"), input, 4);
check(SV("[:::H, :::e, :::l, :::l, :::o]"), SV("{:::>{}}"), input, 4);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a character does not allow the sign option", SV("{::-}"), input);
@@ -130,8 +130,10 @@ void test_char_default(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("^^[:H, :e, :l, :l, :o]^^^"), SV("{:^^{}::>2}"), input, 25);
check(SV("^^[:H, :e, :l, :l, :o]^^^"), SV("{:^^{}::>{}}"), input, 25, 2);
- check_exception("Argument index out of bounds", SV("{:^^{}::>2}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 25);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>2}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 25);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -151,32 +153,32 @@ void test_char_string(TestFunction check, ExceptionTest check_exception, auto&&
check(SV("_Hello__"), SV("{:_^{}s}"), input, 8);
check(SV("###Hello"), SV("{:#>{}s}"), input, 8);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<s}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: s}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#s}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0s}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0s}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.s}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:Ls}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:Ls}"), input);
// *** n
check_exception("The n option and type s can't be used together", SV("{:ns}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
// ***** Only underlying has a format-spec
check_exception("Type s and an underlying format specification can't be used together", SV("{:s:}"), input);
@@ -204,32 +206,32 @@ void test_char_escaped_string(TestFunction check, ExceptionTest check_exception,
check(SV(R"(_"\"Hello'"__)"), SV("{:_^{}?s}"), input, 13);
check(SV(R"(###"\"Hello'")"), SV("{:#>{}?s}"), input, 13);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<?s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<?s}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<?s}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<?s}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-?s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+?s}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: ?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: ?s}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#?s}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0?s}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0?s}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.?s}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L?s}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L?s}"), input);
// *** n
check_exception("The n option and type ?s can't be used together", SV("{:n?s}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
// ***** Only underlying has a format-spec
check_exception("Type ?s and an underlying format specification can't be used together", SV("{:?s:}"), input);
@@ -277,12 +279,10 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
// debug-enabled specialization.
using CharT = wchar_t;
- check_exception("The range-format-spec type s requires formatting a character type",
- SV("{:s}"),
- std::array{'H', 'e', 'l', 'l', 'o'});
- check_exception("The range-format-spec type ?s requires formatting a character type",
- SV("{:?s}"),
- std::array{'H', 'e', 'l', 'l', 'o'});
+ check_exception(
+ "Type s requires character type as formatting argument", SV("{:s}"), std::array{'H', 'e', 'l', 'l', 'o'});
+ check_exception(
+ "Type ?s requires character type as formatting argument", SV("{:?s}"), std::array{'H', 'e', 'l', 'l', 'o'});
}
#endif
@@ -309,36 +309,36 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
check(SV("__[true, true, false]___"), SV("{:_^{}}"), input, 24);
check(SV("#####[true, true, false]"), SV("{:#>{}}"), input, 24);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__true, true, false___"), SV("{:_^22n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[true , true , false ]"), SV("{::7}"), input);
@@ -351,8 +351,8 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
check(SV("[_true__, _true__, _false_]"), SV("{::_^{}}"), input, 7);
check(SV("[:::true, :::true, ::false]"), SV("{:::>{}}"), input, 7);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier for a bool does not allow the sign option", SV("{::-}"), input);
@@ -388,8 +388,10 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
check(SV("^^[:::true, :::true, ::false]^^^"), SV("{:^^{}::>7}"), input, 32);
check(SV("^^[:::true, :::true, ::false]^^^"), SV("{:^^{}::>{}}"), input, 32, 7);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 32);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 32);
}
//
@@ -413,36 +415,36 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("__[1, 2, 42, -42]___"), SV("{:_^{}}"), input, 20);
check(SV("#####[1, 2, 42, -42]"), SV("{:#>{}}"), input, 20);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__1, 2, 42, -42___"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[ 1, 2, 42, -42]"), SV("{::5}"), input);
@@ -455,8 +457,8 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("[__1__, __2__, _42__, _-42_]"), SV("{::_^{}}"), input, 5);
check(SV("[::::1, ::::2, :::42, ::-42]"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check(SV("[1, 2, 42, -42]"), SV("{::-}"), input);
@@ -486,8 +488,10 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
check(SV("^^[::::1, ::::2, :::42, ::-42]^^^"), SV("{:^^{}::>5}"), input, 33);
check(SV("^^[::::1, ::::2, :::42, ::-42]^^^"), SV("{:^^{}::>{}}"), input, 33, 5);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 33);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 33);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -520,36 +524,36 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("__[-42.5, 0, 1.25, 42.5]___"), SV("{:_^{}}"), input, 27);
check(SV("#####[-42.5, 0, 1.25, 42.5]"), SV("{:#>{}}"), input, 27);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__-42.5, 0, 1.25, 42.5___"), SV("{:_^25n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[-42.5, 0, 1.25, 42.5]"), SV("{::5}"), input);
@@ -562,8 +566,8 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("[-42.5, __0__, 1.25_, 42.5_]"), SV("{::_^{}}"), input, 5);
check(SV("[-42.5, ::::0, :1.25, :42.5]"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check(SV("[-42.5, 0, 1.25, 42.5]"), SV("{::-}"), input);
@@ -584,7 +588,7 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("[-42, 0, 1.2, 42]"), SV("{::.{}}"), input, 2);
check(SV("[-42.500, 0.000, 1.250, 42.500]"), SV("{::.{}f}"), input, 3);
- check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+ check_exception("The precision option does not contain a value or an argument index", SV("{::.}"), input);
// *** locale-specific form ***
check(SV("[-42.5, 0, 1.25, 42.5]"), SV("{::L}"), input); // does not require locales present
@@ -615,9 +619,16 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
check(SV("^^[::-42, ::::0, ::1.2, :::42]^^^"), SV("{:^^{}::>{}.2}"), input, 33, 5);
check(SV("^^[::-42, ::::0, ::1.2, :::42]^^^"), SV("{:^^{}::>{}.{}}"), input, 33, 5, 2);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5.2}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}.2}"), input, 33);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}.{}}"), input, 33, 5);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5.2}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}.2}"), input, 33);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied",
+ SV("{:^^{}::>{}.{}}"),
+ input,
+ 33,
+ 5);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -650,34 +661,34 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("__[0x0]___"), SV("{:_^{}}"), input, 10);
check(SV("#####[0x0]"), SV("{:#>{}}"), input, 10);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("_0x0_"), SV("{:_^5n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[ 0x0]"), SV("{::5}"), input);
@@ -690,8 +701,8 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("[_0x0_]"), SV("{::_^{}}"), input, 5);
check(SV("[::0x0]"), SV("{:::>{}}"), input, 5);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
@@ -723,8 +734,10 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
check(SV("^^[::0x0]^^^"), SV("{:^^{}::>5}"), input, 12);
check(SV("^^[::0x0]^^^"), SV("{:^^{}::>{}}"), input, 12, 5);
- check_exception("Argument index out of bounds", SV("{:^^{}::>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 12);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 12);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -755,34 +768,34 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"(__["Hello", "world"]___)"), SV("{:_^{}}"), input, 23);
check(SV(R"(#####["Hello", "world"])"), SV("{:#>{}}"), input, 23);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV(R"(_"Hello", "world"_)"), SV("{:_^18n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV(R"([Hello , world ])"), SV("{::8}"), input);
@@ -795,8 +808,8 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"([_Hello__, _world__])"), SV("{::_^{}}"), input, 8);
check(SV(R"([:::Hello, :::world])"), SV("{:::>{}}"), input, 8);
- check_exception("The format-spec fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
@@ -805,21 +818,21 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
check(SV(R"([Hel, wor])"), SV("{::.3}"), input);
check(SV(R"([Hel, wor])"), SV("{::.{}}"), input, 3);
- check_exception("The format-spec precision field doesn't contain a value or arg-id", SV("{::.}"), input);
+ check_exception("The precision option does not contain a value or an argument index", SV("{::.}"), input);
// *** locale-specific form ***
check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s?"))
- check_exception("The format-spec type has a type not supported for a string argument", fmt, input);
+ check_exception("The type option contains an invalid value for a string formatting argument", fmt, input);
// ***** Both have a format-spec
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^25::>8}"), input);
@@ -830,8 +843,10 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>8}"), input, 25);
check(SV(R"(^^[:::Hello, :::world]^^^)"), SV("{:^^{}::>{}}"), input, 25, 8);
- check_exception("Argument index out of bounds", SV("{:^^{}::>8}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}::>{}}"), input, 25);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>8}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}::>{}}"), input, 25);
}
template <class CharT, class TestFunction, class ExceptionTest>
@@ -864,41 +879,41 @@ void test_status(TestFunction check, ExceptionTest check_exception) {
check(SV("__[0xaaaa, 0x5555, 0xaa55]___"), SV("{:_^{}}"), input, 29);
check(SV("#####[0xaaaa, 0x5555, 0xaa55]"), SV("{:#>{}}"), input, 29);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__0xaaaa, 0x5555, 0xaa55___"), SV("{:_^27n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
- check_exception("The format-spec type has a type not supported for a status argument", SV("{::*<7}"), input);
+ check_exception("The type option contains an invalid value for a status formatting argument", SV("{::*<7}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("sxX"))
- check_exception("The format-spec type has a type not supported for a status argument", fmt, input);
+ check_exception("The type option contains an invalid value for a status formatting argument", fmt, input);
check(SV("[0xaaaa, 0x5555, 0xaa55]"), SV("{::x}"), input);
check(SV("[0XAAAA, 0X5555, 0XAA55]"), SV("{::X}"), input);
@@ -908,7 +923,7 @@ void test_status(TestFunction check, ExceptionTest check_exception) {
check(SV("^^[0XAAAA, 0X5555, 0XAA55]^^^"), SV("{:^^29:X}"), input);
check(SV("^^[0XAAAA, 0X5555, 0XAA55]^^^"), SV("{:^^{}:X}"), input, 29);
- check_exception("Argument index out of bounds", SV("{:^^{}:X}"), input);
+ check_exception("The argument index value is too large for the number of arguments supplied", SV("{:^^{}:X}"), input);
}
//
@@ -945,26 +960,26 @@ void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& i
check(SV("__[(1, 'a'), (42, '*')]___"), SV("{:_^{}}"), input, 26);
check(SV("#####[(1, 'a'), (42, '*')]"), SV("{:#>{}}"), input, 26);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__(1, 'a'), (42, '*')___"), SV("{:_^24n}"), input);
@@ -972,10 +987,10 @@ void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& i
// *** type ***
check(SV("__{(1, 'a'), (42, '*')}___"), SV("{:_^26m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[(1, 'a') , (42, '*') ]"), SV("{::11}"), input);
@@ -988,32 +1003,32 @@ void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& i
check(SV("[_(1, 'a')__, _(42, '*')_]"), SV("{::_^{}}"), input, 11);
check(SV("[###(1, 'a'), ##(42, '*')]"), SV("{::#>{}}"), input, 11);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
check(SV("[1: 'a', 42: '*']"), SV("{::m}"), input);
check(SV("[1, 'a', 42, '*']"), SV("{::n}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>(""))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^[###(1, 'a'), ##(42, '*')]^^^"), SV("{:^^31:#>11}"), input);
@@ -1021,8 +1036,10 @@ void test_pair_tuple(TestFunction check, ExceptionTest check_exception, auto&& i
check(SV("^^[###(1, 'a'), ##(42, '*')]^^^"), SV("{:^^{}:#>11}"), input, 31);
check(SV("^^[###(1, 'a'), ##(42, '*')]^^^"), SV("{:^^{}:#>{}}"), input, 31, 11);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 31);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 31);
check(SV("1: 'a', 42: '*'"), SV("{:n:m}"), input);
check(SV("1, 'a', 42, '*'"), SV("{:n:n}"), input);
@@ -1061,36 +1078,36 @@ void test_tuple_int(TestFunction check, ExceptionTest check_exception) {
check(SV("__[(42), (99)]___"), SV("{:_^{}}"), input, 17);
check(SV("#####[(42), (99)]"), SV("{:#>{}}"), input, 17);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__(42), (99)___"), SV("{:_^15n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[(42) , (99) ]"), SV("{::7}"), input);
@@ -1103,31 +1120,31 @@ void test_tuple_int(TestFunction check, ExceptionTest check_exception) {
check(SV("[_(42)__, _(99)__]"), SV("{::_^{}}"), input, 7);
check(SV("[###(42), ###(99)]"), SV("{::#>{}}"), input, 7);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
check(SV("[42, 99]"), SV("{::n}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>(""))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^[###(42), ###(99)]^^^"), SV("{:^^23:#>7}"), input);
@@ -1135,8 +1152,10 @@ void test_tuple_int(TestFunction check, ExceptionTest check_exception) {
check(SV("^^[###(42), ###(99)]^^^"), SV("{:^^{}:#>7}"), input, 23);
check(SV("^^[###(42), ###(99)]^^^"), SV("{:^^{}:#>{}}"), input, 23, 7);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 23);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 23);
}
//
@@ -1162,36 +1181,36 @@ void test_tuple_int_int_int(TestFunction check, ExceptionTest check_exception) {
check(SV("__[(42, 99, 0), (1, 10, 100)]___"), SV("{:_^{}}"), input, 32);
check(SV("#####[(42, 99, 0), (1, 10, 100)]"), SV("{:#>{}}"), input, 32);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** n
check(SV("__(42, 99, 0), (1, 10, 100)___"), SV("{:_^30n}"), input);
// *** type ***
- check_exception("The range-format-spec type m requires two elements for a pair or tuple", SV("{:m}"), input);
- check_exception("The range-format-spec type s requires formatting a character type", SV("{:s}"), input);
- check_exception("The range-format-spec type ?s requires formatting a character type", SV("{:?s}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
+ check_exception("Type s requires character type as formatting argument", SV("{:s}"), input);
+ check_exception("Type ?s requires character type as formatting argument", SV("{:?s}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Only underlying has a format-spec
check(SV("[(42, 99, 0) , (1, 10, 100) ]"), SV("{::14}"), input);
@@ -1204,31 +1223,31 @@ void test_tuple_int_int_int(TestFunction check, ExceptionTest check_exception) {
check(SV("[_(42, 99, 0)__, _(1, 10, 100)_]"), SV("{::_^{}}"), input, 14);
check(SV("[###(42, 99, 0), ##(1, 10, 100)]"), SV("{::#>{}}"), input, 14);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:::<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::{<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{::05}"), input);
+ check_exception("The width option should not have a leading zero", SV("{::05}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{::L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{::L}"), input);
// *** type ***
check(SV("[42, 99, 0, 1, 10, 100]"), SV("{::n}"), input);
for (std::basic_string_view<CharT> fmt : fmt_invalid_nested_types<CharT>("s"))
- check_exception("The format-spec should consume the input or end with a '}'", fmt, input);
+ check_exception("The format specifier should consume the input or end with a '}'", fmt, input);
// ***** Both have a format-spec
check(SV("^^[###(42, 99, 0), ##(1, 10, 100)]^^^"), SV("{:^^37:#>14}"), input);
@@ -1236,8 +1255,10 @@ void test_tuple_int_int_int(TestFunction check, ExceptionTest check_exception) {
check(SV("^^[###(42, 99, 0), ##(1, 10, 100)]^^^"), SV("{:^^{}:#>14}"), input, 37);
check(SV("^^[###(42, 99, 0), ##(1, 10, 100)]^^^"), SV("{:^^{}:#>{}}"), input, 37, 14);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>5}"), input);
- check_exception("Argument index out of bounds", SV("{:^^{}:#>{}}"), input, 37);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>5}"), input);
+ check_exception(
+ "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 37);
}
//
diff --git a/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h b/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
index e649543..dd99d20 100644
--- a/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
+++ b/libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h
@@ -42,33 +42,33 @@ void test_tuple_or_pair_int_int(TestFunction check, ExceptionTest check_exceptio
check(SV("__(42, 99)___"), SV("{:_^{}}"), input, 13);
check(SV("#####(42, 99)"), SV("{:#>{}}"), input, 13);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** type ***
check(SV("__42: 99___"), SV("{:_^11m}"), input);
check(SV("__42, 99___"), SV("{:_^11n}"), input);
for (CharT c : SV("aAbBcdeEfFgGopPsxX?")) {
- check_exception("The format-spec should consume the input or end with a '}'",
+ check_exception("The format specifier should consume the input or end with a '}'",
std::basic_string_view{STR("{:") + c + STR("}")},
input);
}
@@ -89,33 +89,33 @@ void test_tuple_or_pair_int_string(TestFunction check, ExceptionTest check_excep
check(SV("__(42, \"hello\")___"), SV("{:_^{}}"), input, 18);
check(SV("#####(42, \"hello\")"), SV("{:#>{}}"), input, 18);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** type ***
check(SV("__42: \"hello\"___"), SV("{:_^16m}"), input);
check(SV("__42, \"hello\"___"), SV("{:_^16n}"), input);
for (CharT c : SV("aAbBcdeEfFgGopPsxX?")) {
- check_exception("The format-spec should consume the input or end with a '}'",
+ check_exception("The format specifier should consume the input or end with a '}'",
std::basic_string_view{STR("{:") + c + STR("}")},
input);
}
@@ -179,33 +179,33 @@ void test_tuple_int(TestFunction check, ExceptionTest check_exception) {
check(SV("__(42)___"), SV("{:_^{}}"), input, 9);
check(SV("#####(42)"), SV("{:#>{}}"), input, 9);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** type ***
- check_exception("The format specifier m requires a pair or a two-element tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
check(SV("__42___"), SV("{:_^7n}"), input);
for (CharT c : SV("aAbBcdeEfFgGopPsxX?")) {
- check_exception("The format-spec should consume the input or end with a '}'",
+ check_exception("The format specifier should consume the input or end with a '}'",
std::basic_string_view{STR("{:") + c + STR("}")},
input);
}
@@ -228,33 +228,33 @@ void test_tuple_int_string_color(TestFunction check, ExceptionTest check_excepti
check(SV("__(42, \"hello\", \"red\")___"), SV("{:_^{}}"), input, 25);
check(SV("#####(42, \"hello\", \"red\")"), SV("{:#>{}}"), input, 25);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** type ***
- check_exception("The format specifier m requires a pair or a two-element tuple", SV("{:m}"), input);
+ check_exception("Type m requires a pair or a tuple with two elements", SV("{:m}"), input);
check(SV("__42, \"hello\", \"red\"___"), SV("{:_^23n}"), input);
for (CharT c : SV("aAbBcdeEfFgGopPsxX?")) {
- check_exception("The format-spec should consume the input or end with a '}'",
+ check_exception("The format specifier should consume the input or end with a '}'",
std::basic_string_view{STR("{:") + c + STR("}")},
input);
}
@@ -301,33 +301,33 @@ void test_nested(TestFunction check, ExceptionTest check_exception, Nested&& inp
check(SV("__(42, (\"hello\", \"red\"))___"), SV("{:_^{}}"), input, 27);
check(SV("#####(42, (\"hello\", \"red\"))"), SV("{:#>{}}"), input, 27);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:}<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{:{<}"), input);
- check_exception("The format-spec range-fill field contains an invalid character", SV("{::<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:}<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{:{<}"), input);
+ check_exception("The fill option contains an invalid value", SV("{::<}"), input);
// *** sign ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:-}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:+}"), input);
- check_exception("The format-spec should consume the input or end with a '}'", SV("{: }"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:-}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:+}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{: }"), input);
// *** alternate form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:#}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:#}"), input);
// *** zero-padding ***
- check_exception("A format-spec width field shouldn't have a leading zero", SV("{:0}"), input);
+ check_exception("The width option should not have a leading zero", SV("{:0}"), input);
// *** precision ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:.}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:.}"), input);
// *** locale-specific form ***
- check_exception("The format-spec should consume the input or end with a '}'", SV("{:L}"), input);
+ check_exception("The format specifier should consume the input or end with a '}'", SV("{:L}"), input);
// *** type ***
check(SV("__42: (\"hello\", \"red\")___"), SV("{:_^25m}"), input);
check(SV("__42, (\"hello\", \"red\")___"), SV("{:_^25n}"), input);
for (CharT c : SV("aAbBcdeEfFgGopPsxX?")) {
- check_exception("The format-spec should consume the input or end with a '}'",
+ check_exception("The format specifier should consume the input or end with a '}'",
std::basic_string_view{STR("{:") + c + STR("}")},
input);
}
diff --git a/libcxx/test/support/format.functions.common.h b/libcxx/test/support/format.functions.common.h
index 656ac99..8345707 100644
--- a/libcxx/test/support/format.functions.common.h
+++ b/libcxx/test/support/format.functions.common.h
@@ -76,12 +76,12 @@ struct std::formatter<status, CharT> {
case CharT('}'):
return begin;
default:
- throw_format_error("The format-spec type has a type not supported for a status argument");
+ throw_format_error("The type option contains an invalid value for a status formatting argument");
}
++begin;
if (begin != end && *begin != CharT('}'))
- throw_format_error("The format-spec should consume the input or end with a '}'");
+ throw_format_error("The format specifier should consume the input or end with a '}'");
return begin;
}