From 8c62c69275eebd5361d44ed37f037567347a4598 Mon Sep 17 00:00:00 2001 From: Luca Della Vedova Date: Fri, 10 Jan 2025 17:37:14 +0800 Subject: [PATCH] Add test case Signed-off-by: Luca Della Vedova --- nexus_common/src/task_remapper_test.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nexus_common/src/task_remapper_test.cpp b/nexus_common/src/task_remapper_test.cpp index 2c90453..44c8bdf 100644 --- a/nexus_common/src/task_remapper_test.cpp +++ b/nexus_common/src/task_remapper_test.cpp @@ -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") { @@ -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"); +} + }