diff --git a/libcxx/include/__chrono/formatter.h b/libcxx/include/__chrono/formatter.h --- a/libcxx/include/__chrono/formatter.h +++ b/libcxx/include/__chrono/formatter.h @@ -513,19 +513,19 @@ } 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 @@ // - 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 --- a/libcxx/include/__chrono/parser_std_format_spec.h +++ b/libcxx/include/__chrono/parser_std_format_spec.h @@ -166,12 +166,12 @@ "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 @@ __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 --- a/libcxx/include/__format/format_functions.h +++ b/libcxx/include/__format/format_functions.h @@ -127,13 +127,13 @@ _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 @@ __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 @@ _VSTD::__visit_format_arg( [&](auto __arg) { if constexpr (same_as) - 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::handle>) __arg.format(__parse_ctx, __ctx); else { diff --git a/libcxx/include/__format/format_string.h b/libcxx/include/__format/format_string.h --- a/libcxx/include/__format/format_string.h +++ b/libcxx/include/__format/format_string.h @@ -124,7 +124,7 @@ 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 @@ 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 --- a/libcxx/include/__format/formatter_tuple.h +++ b/libcxx/include/__format/formatter_tuple.h @@ -60,11 +60,11 @@ 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 --- a/libcxx/include/__format/parser_std_format_spec.h +++ b/libcxx/include/__format/parser_std_format_spec.h @@ -70,12 +70,12 @@ // 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 @@ [](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 @@ 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 @@ // 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 @@ __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 @@ "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 @@ template _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 @@ ++__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 @@ } 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 @@ 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 --- a/libcxx/include/__format/range_formatter.h +++ b/libcxx/include/__format/range_formatter.h @@ -81,7 +81,7 @@ // 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 @@ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ // 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 @@ 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 @@ __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 --- 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ for (std::basic_string_view fmt : fmt_invalid_nested_types("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 @@ -147,32 +149,32 @@ 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, 10); - check_exception("The format-spec range-fill field contains an invalid character", 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -432,36 +432,36 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -538,36 +540,36 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ 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 @@ -667,34 +676,34 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -773,34 +784,34 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 @@ -881,41 +894,41 @@ 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 fmt : fmt_invalid_types("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 fmt : fmt_invalid_nested_types("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 @@ 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 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 --- 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 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 --- 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 @@ #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 @@ 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.hh_mm_ss.pass.cpp b/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp --- 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 @@ // 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 @@ -550,14 +550,13 @@ 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.day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.day.pass.cpp --- 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 @@ test_valid_values(); check_invalid_types({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 --- 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 @@ 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 @@ 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 --- 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 @@ 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.local_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp --- 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 @@ }, 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 --- 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 @@ template 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 fmt = SV("{:%%b='%b'%t%%B='%B'%t%%h='%h'%t%%m='%m'%t%%Om='%Om'%n}"); constexpr std::basic_string_view lfmt = SV("{:L%%b='%b'%t%%B='%B'%t%%h='%h'%t%%m='%m'%t%%Om='%Om'%n}"); @@ -180,14 +180,14 @@ test_valid_values(); check_invalid_types({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 --- 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 @@ template 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 @@ check_invalid_types({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 @@ 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 --- 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 @@ template 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 @@ {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 @@ "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 --- 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 @@ 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 @@ 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 @@ // 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 --- 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 @@ 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 --- 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 @@ template 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 fmt = SV("{:%%u='%u'%t%%Ou='%Ou'%t%%w='%w'%t%%Ow='%Ow'%n}"); constexpr std::basic_string_view lfmt = SV("{:L%%u='%u'%t%%Ou='%Ou'%t%%w='%w'%t%%Ow='%Ow'%n}"); @@ -191,14 +191,14 @@ check_invalid_types( {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 --- 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 @@ template 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 @@ check_invalid_types({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 @@ 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 --- 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 @@ template 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 @@ 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 @@ "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 --- 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 @@ check_invalid_types( {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 --- 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 @@ template 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 @@ {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 @@ 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 --- 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 @@ template 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 @@ 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 @@ 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 --- 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 @@ 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 @@ 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 @@ // 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 --- 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 @@ 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 @@ 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 @@ // 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 --- 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 @@ // 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 @@ // 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 @@ // 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 --- 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 @@ // Invalid Unicode Scalar Values if constexpr (std::same_as) { - 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 --- 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 @@ 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 @@ #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 @@ 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 @@ const char* valid_types = "s"; #endif for (const auto& fmt : invalid_types(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 @@ -978,12 +978,16 @@ 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("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 @@ -1018,6 +1022,10 @@ 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 @@ const char* valid_types = "bBcdoxX"; #endif for (const auto& fmt : invalid_types(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 @@ -2964,7 +2972,13 @@ 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 @@ // *** type *** for (const auto& fmt : invalid_types("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 @@ -3073,7 +3087,6 @@ template void format_tests(TestFunction check, ExceptionTest check_exception) { // *** Test escaping *** - check(SV("{"), SV("{{")); check(SV("}"), SV("}}")); check(SV("{:^}"), SV("{{:^}}")); @@ -3138,10 +3151,10 @@ 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 @@ format_test_bool(check, check_exception); format_test_bool_as_integer(check, check_exception); } - // *** Test signed integral format argument *** check(SV("hello 42"), SV("hello {}"), static_cast(42)); check(SV("hello 42"), SV("hello {}"), static_cast(42)); @@ -3199,6 +3211,7 @@ #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(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 --- 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("")) - 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("")) - 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 @@ -458,37 +466,37 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("")) - 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("")) - 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("")) - 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 @@ 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 @@ 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 --- 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 @@ 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 @@ 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 @@ 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 @@ 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, 8); - check_exception("The format-spec range-fill field contains an invalid character", 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 @@ 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 @@ 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 // where the types T and charT are the same. This means this can't be used for @@ -365,8 +369,8 @@ // 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -496,37 +502,37 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -706,37 +716,37 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ 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 @@ -835,35 +852,35 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -941,35 +960,35 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 @@ -1050,40 +1071,40 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ // *** 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 --- 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 @@ 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 @@ 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 @@ check(SV("hello"), SV("{:s}"), input); check(SV("\"hello\""), SV("{:?}"), input); for (std::basic_string_view fmt : fmt_invalid_types("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 @@ -131,35 +131,35 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 @@ -256,8 +258,8 @@ 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 @@ 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 @@ check(SV("\"hello\""), SV("{:s}"), input); // escape overrides the type option s check(SV("\"hello\""), SV("{:?}"), input); for (std::basic_string_view fmt : fmt_invalid_types("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 @@ -317,35 +319,35 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 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 --- 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -151,32 +153,32 @@ 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, 13); - check_exception("The format-spec range-fill field contains an invalid character", 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -520,36 +524,36 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ 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 @@ -650,34 +661,34 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 @@ -755,34 +768,34 @@ 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 fmt : fmt_invalid_types("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 @@ 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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 @@ -864,41 +879,41 @@ 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 fmt : fmt_invalid_types("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 fmt : fmt_invalid_nested_types("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 @@ 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 @@ 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 @@ // *** 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("")) - 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 @@ 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("")) - 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 @@ 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 @@ 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 fmt : fmt_invalid_types("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 @@ 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 fmt : fmt_invalid_nested_types("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 @@ 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 --- 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 --- a/libcxx/test/support/format.functions.common.h +++ b/libcxx/test/support/format.functions.common.h @@ -76,12 +76,12 @@ 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; }