From 967be9e750221ab2ab783f95df79bb26d290a45e Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:07:58 +0200 Subject: add: added projects --- tiger-compiler/tests/testsuite/good/subtests.tig | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tiger-compiler/tests/testsuite/good/subtests.tig (limited to 'tiger-compiler/tests/testsuite/good/subtests.tig') diff --git a/tiger-compiler/tests/testsuite/good/subtests.tig b/tiger-compiler/tests/testsuite/good/subtests.tig new file mode 100644 index 0000000..87ff369 --- /dev/null +++ b/tiger-compiler/tests/testsuite/good/subtests.tig @@ -0,0 +1,24 @@ +// test_proceed should not be considered unit tests + +function test_letexp() = + let + var a := 10 + var b := 20 + + function add(x: int, y: int): int = x + y + function sub(x: int, y: int): int = x - y + function mul(x: int, y: int): int = x * y + + function test_proceed() = + let + function test_result(actual: int, expected: int) = assert actual = expected + in + ( + test_result(add(a, b), 30); + test_result(sub(a, b), -10); + test_result(mul(a, b), 200) + ) + end + in + test_proceed() + end -- cgit v1.2.3