Skip to content

Commit

Permalink
Merge pull request #11119 from keymanapp/chore/core/dx-better-embedde…
Browse files Browse the repository at this point in the history
…d-test-msg

chore(core): dx better err message on embedded test vkeys 🙀
  • Loading branch information
srl295 authored Apr 2, 2024
2 parents 9333dfa + 73b951c commit 8d2fe35
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/tests/unit/ldml/ldml_test_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,19 @@ 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
assert(!std::getline(f, s, ' '));
if (std::getline(f, s, ' ')) {
std::cerr << "Error parsing vkey ["<<vk_event<<"] - excess string after key: " << s << std::endl;
assert(false);
}
assert(vk != 0);

return {vk, modifier_state};
Expand Down

0 comments on commit 8d2fe35

Please sign in to comment.