From b8dab6cf7cf641058349bd34d55192e1bcb4aaf6 Mon Sep 17 00:00:00 2001 From: David Mak Date: Wed, 21 Aug 2024 16:24:05 +0800 Subject: [PATCH] [standalone] Add tests for string equality --- nac3standalone/demo/src/str.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 nac3standalone/demo/src/str.py diff --git a/nac3standalone/demo/src/str.py b/nac3standalone/demo/src/str.py new file mode 100644 index 000000000..d28f05e2c --- /dev/null +++ b/nac3standalone/demo/src/str.py @@ -0,0 +1,30 @@ +@extern +def output_bool(x: bool): + ... + + +def str_eq(): + output_bool("" == "") + output_bool("a" == "") + output_bool("a" == "b") + output_bool("b" == "a") + output_bool("a" == "a") + output_bool("test string" == "test string") + output_bool("test string1" == "test string2") + + +def str_ne(): + output_bool("" != "") + output_bool("a" != "") + output_bool("a" != "b") + output_bool("b" != "a") + output_bool("a" != "a") + output_bool("test string" != "test string") + output_bool("test string1" != "test string2") + + +def run() -> int32: + str_eq() + str_ne() + + return 0