From 32f9e390ed198c9fbfca5fed5e8ea6fd3ffa8e7d Mon Sep 17 00:00:00 2001 From: Martin Kobelka Date: Sun, 26 Nov 2017 00:49:06 +0100 Subject: [PATCH] Add some expression tests --- ifj2017/tests/04_expressions/31.code | 5 +++++ ifj2017/tests/04_expressions/31.stdout | 1 + ifj2017/tests/04_expressions/32.code | 8 ++++++++ ifj2017/tests/04_expressions/32.stdout | 1 + ifj2017/tests/04_expressions/33.code | 7 +++++++ ifj2017/tests/04_expressions/33.stdout | 1 + ifj2017/tests/04_expressions/34.code | 7 +++++++ ifj2017/tests/04_expressions/34.stdout | 1 + ifj2017/tests/04_expressions/35.code | 5 +++++ ifj2017/tests/04_expressions/35.stdout | 1 + 10 files changed, 37 insertions(+) create mode 100644 ifj2017/tests/04_expressions/31.code create mode 100644 ifj2017/tests/04_expressions/31.stdout create mode 100644 ifj2017/tests/04_expressions/32.code create mode 100644 ifj2017/tests/04_expressions/32.stdout create mode 100644 ifj2017/tests/04_expressions/33.code create mode 100644 ifj2017/tests/04_expressions/33.stdout create mode 100644 ifj2017/tests/04_expressions/34.code create mode 100644 ifj2017/tests/04_expressions/34.stdout create mode 100644 ifj2017/tests/04_expressions/35.code create mode 100644 ifj2017/tests/04_expressions/35.stdout diff --git a/ifj2017/tests/04_expressions/31.code b/ifj2017/tests/04_expressions/31.code new file mode 100644 index 0000000..6332368 --- /dev/null +++ b/ifj2017/tests/04_expressions/31.code @@ -0,0 +1,5 @@ +' Random math expression test + +scope + print 565656/(56565+(56567/565/6778*6567886)) * 4; +end scope diff --git a/ifj2017/tests/04_expressions/31.stdout b/ifj2017/tests/04_expressions/31.stdout new file mode 100644 index 0000000..2c8c85b --- /dev/null +++ b/ifj2017/tests/04_expressions/31.stdout @@ -0,0 +1 @@ + 14.7325 \ No newline at end of file diff --git a/ifj2017/tests/04_expressions/32.code b/ifj2017/tests/04_expressions/32.code new file mode 100644 index 0000000..b8826e0 --- /dev/null +++ b/ifj2017/tests/04_expressions/32.code @@ -0,0 +1,8 @@ +' Random math expression test + +scope + dim a as double + a = (565656\(1689\1.001\1.51111)+55656/5665\3.5\1.5\5.5) / 3 + print a; + +end scope \ No newline at end of file diff --git a/ifj2017/tests/04_expressions/32.stdout b/ifj2017/tests/04_expressions/32.stdout new file mode 100644 index 0000000..3457866 --- /dev/null +++ b/ifj2017/tests/04_expressions/32.stdout @@ -0,0 +1 @@ + 223.333 \ No newline at end of file diff --git a/ifj2017/tests/04_expressions/33.code b/ifj2017/tests/04_expressions/33.code new file mode 100644 index 0000000..c845a55 --- /dev/null +++ b/ifj2017/tests/04_expressions/33.code @@ -0,0 +1,7 @@ +' Random math expression with - + +scope + dim a as double + print ((0-4576.5656*4)*676/5/65.67\6.68*(0-58.56678))/(0-5); + +end scope \ No newline at end of file diff --git a/ifj2017/tests/04_expressions/33.stdout b/ifj2017/tests/04_expressions/33.stdout new file mode 100644 index 0000000..788a72c --- /dev/null +++ b/ifj2017/tests/04_expressions/33.stdout @@ -0,0 +1 @@ +-19.2 \ No newline at end of file diff --git a/ifj2017/tests/04_expressions/34.code b/ifj2017/tests/04_expressions/34.code new file mode 100644 index 0000000..4d21eca --- /dev/null +++ b/ifj2017/tests/04_expressions/34.code @@ -0,0 +1,7 @@ +' Random math expression with - + +scope + dim a as double + print ((0-5)*(0-6))*(0-7); + +end scope \ No newline at end of file diff --git a/ifj2017/tests/04_expressions/34.stdout b/ifj2017/tests/04_expressions/34.stdout new file mode 100644 index 0000000..9b277fe --- /dev/null +++ b/ifj2017/tests/04_expressions/34.stdout @@ -0,0 +1 @@ +-210 \ No newline at end of file diff --git a/ifj2017/tests/04_expressions/35.code b/ifj2017/tests/04_expressions/35.code new file mode 100644 index 0000000..0f7cea5 --- /dev/null +++ b/ifj2017/tests/04_expressions/35.code @@ -0,0 +1,5 @@ +' Expression with - + +scope + print 0-54577; +end scope \ No newline at end of file diff --git a/ifj2017/tests/04_expressions/35.stdout b/ifj2017/tests/04_expressions/35.stdout new file mode 100644 index 0000000..8c00ea3 --- /dev/null +++ b/ifj2017/tests/04_expressions/35.stdout @@ -0,0 +1 @@ +-54577 \ No newline at end of file