SDC: Add unit test for escaping dollar sign in wire names Signed-off-by: Tomasz Michalak <tmichalak@antmicro.com>
diff --git a/sdc-plugin/tests/Makefile b/sdc-plugin/tests/Makefile index 607b14b..b5f7f96 100644 --- a/sdc-plugin/tests/Makefile +++ b/sdc-plugin/tests/Makefile
@@ -16,6 +16,8 @@ period_check \ waveform_check +UNIT_TESTS = escaping + include $(shell pwd)/../../Makefile_test.common counter_verify = $(call diff_test,counter,sdc) && $(call diff_test,counter,txt)
diff --git a/sdc-plugin/tests/escaping/escaping.test.cc b/sdc-plugin/tests/escaping/escaping.test.cc new file mode 100644 index 0000000..e17eef6 --- /dev/null +++ b/sdc-plugin/tests/escaping/escaping.test.cc
@@ -0,0 +1,11 @@ +#include <clocks.h> + +#include <gtest/gtest.h> + +TEST(ClockTest, EscapeDollarSign) { + // convert wire_name to wire_name, i.e. unchanged + EXPECT_EQ(Clock::AddEscaping("wire_name"), "wire_name"); + // convert $wire_name to \$wire_name + EXPECT_EQ(Clock::AddEscaping("$wire_name"), "\\$wire_name"); +} +