From 4881d1aab0845f572536c0e06e53de43e32e828e Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 28 Mar 2024 12:41:42 -0500 Subject: [PATCH 1/2] chore(core): dx better err message on embedded test vkeys --- core/tests/unit/ldml/ldml_test_source.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/tests/unit/ldml/ldml_test_source.cpp b/core/tests/unit/ldml/ldml_test_source.cpp index b638379bb6d..2ab85368763 100644 --- a/core/tests/unit/ldml/ldml_test_source.cpp +++ b/core/tests/unit/ldml/ldml_test_source.cpp @@ -372,7 +372,10 @@ LdmlEmbeddedTestSource::vkey_to_event(std::string const &vk_event) { } // The string should be empty at this point - assert(!std::getline(f, s, ' ')); + if (std::getline(f, s, ' ')) { + std::cerr << "Error parsing vkey ["< Date: Thu, 28 Mar 2024 13:21:30 -0500 Subject: [PATCH 2/2] chore(core): dx even better err message on embedded test vkeys - report on vk-not-found - separate message for excess string --- core/tests/unit/ldml/ldml_test_source.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/tests/unit/ldml/ldml_test_source.cpp b/core/tests/unit/ldml/ldml_test_source.cpp index 2ab85368763..71c5a7ee4e0 100644 --- a/core/tests/unit/ldml/ldml_test_source.cpp +++ b/core/tests/unit/ldml/ldml_test_source.cpp @@ -367,13 +367,17 @@ LdmlEmbeddedTestSource::vkey_to_event(std::string const &vk_event) { modifier_state |= modifier; } else { vk = get_vk(s); - break; + if (vk == 0) { + std::cerr << "Error parsing [" << vk_event << "] - could not find vkey or modifier: " << s << std::endl; + } + assert(vk != 0); + break; // only one vkey allowed } } // The string should be empty at this point if (std::getline(f, s, ' ')) { - std::cerr << "Error parsing vkey ["<