From 196aeb6da01ef5ed34c37701d18f3bd2e0800f6e Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sat, 12 Aug 2023 17:47:58 +0000 Subject: [PATCH] Fix lint issue about nonascii symbol --- test/core_name/Jamfile.v2 | 11 ++++++++++- ...mes_nonascii.cpp => fields_names_nonascii.cpp.tpl} | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) rename test/core_name/{fields_names_nonascii.cpp => fields_names_nonascii.cpp.tpl} (90%) diff --git a/test/core_name/Jamfile.v2 b/test/core_name/Jamfile.v2 index a64053c..e77c04a 100644 --- a/test/core_name/Jamfile.v2 +++ b/test/core_name/Jamfile.v2 @@ -33,7 +33,6 @@ explicit compiler_supports_cxx20_nontype_template_args ; ########## END of helpers to detect C++20 non-type template args support - local REQUIRE_CXX20_NONTYPE_TEMPLATE_ARGS = [ check-target-builds ../core_name//compiler_supports_cxx20_nontype_template_args : : no ] ; @@ -46,6 +45,16 @@ project ; +########## BEGIN of helpers to prepare the test with non-ascii field name + +actions insert_utf8_action +{ + sed 's/%ARG%/\xcf\x80/' $(>) > $(<) +} + +make fields_names_nonascii.cpp : fields_names_nonascii.cpp.tpl : @insert_utf8_action ; + +########## END of helpers to prepare the test with non-ascii field name test-suite pfr_tests : diff --git a/test/core_name/fields_names_nonascii.cpp b/test/core_name/fields_names_nonascii.cpp.tpl similarity index 90% rename from test/core_name/fields_names_nonascii.cpp rename to test/core_name/fields_names_nonascii.cpp.tpl index cda338c..2e83aac 100644 --- a/test/core_name/fields_names_nonascii.cpp +++ b/test/core_name/fields_names_nonascii.cpp.tpl @@ -17,16 +17,16 @@ namespace testing { namespace { struct Aggregate { - int _π; + int _%ARG%; }; void test_get_name() { - BOOST_TEST_EQ( ((boost::pfr::get_name<0, Aggregate>())), "_π"); + BOOST_TEST_EQ( ((boost::pfr::get_name<0, Aggregate>())), "_%ARG%"); } void test_names_as_array() { const auto expected = std::array{ - "_π" + "_%ARG%" }; const auto value = boost::pfr::names_as_array(); BOOST_TEST_EQ(expected.size(), value.size());