Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <[email protected]>
  • Loading branch information
luca-della-vedova committed Jan 10, 2025
1 parent b881d1e commit 8c62c69
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion nexus_common/src/task_remapper_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST_CASE("task_remapping") {
auto remapper = TaskRemapper(param);
CHECK(remapper.remap("pick") == "pick_and_place");
CHECK(remapper.remap("place") == "pick_and_place");
CHECK(remapper.remap("other") == "other");
CHECK(remapper.remap("other") == std::nullopt);
}

TEST_CASE("task_remapping_with_wildcard") {
Expand All @@ -45,4 +45,14 @@ TEST_CASE("task_remapping_with_wildcard") {
CHECK(remapper.remap("other") == "main");
}

TEST_CASE("task_remapping_with_normal_and_wildcard") {
std::string param =
R"(
pick_and_place: [pick, "*"]
)";
auto remapper = TaskRemapper(param);
CHECK(remapper.remap("pick") == "pick_and_place");
CHECK(remapper.remap("place") == "pick_and_place");
}

}

0 comments on commit 8c62c69

Please sign in to comment.