From 34952a3e26ddd180826ccd31c3fa300db7f0b4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Fri, 4 Mar 2022 07:58:52 -0700 Subject: [PATCH] Add a test for str as args and return values --- integration_tests/run_tests.py | 1 + integration_tests/test_str_02.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 integration_tests/test_str_02.py diff --git a/integration_tests/run_tests.py b/integration_tests/run_tests.py index e563d92434..8f3eb215f6 100755 --- a/integration_tests/run_tests.py +++ b/integration_tests/run_tests.py @@ -12,6 +12,7 @@ "expr_04.py", "expr_05.py", "test_str_01.py", + "test_str_02.py", "modules_01.py", #"modules_02.py", "test_math.py", diff --git a/integration_tests/test_str_02.py b/integration_tests/test_str_02.py new file mode 100644 index 0000000000..596ca1ac9f --- /dev/null +++ b/integration_tests/test_str_02.py @@ -0,0 +1,20 @@ +def f(): + x: str + x = "abcdefghijkl" + x = x + "123" + assert x == "abcdefghijkl123" + g(x) + y: str + y = h(x) + print(y) + assert y == "abcdefghijkl123|x" + +def g(x: str): + print(x) + assert x == "abcdefghijkl123" + +def h(x: str) -> str: + return x + "|x" + + +f()