annotate truffle/com.oracle.truffle.sl.test/src/tests/Call.sl @ 22201:df6a1647cfb3

Move .sl testcases/outputs (resources) into projects src directory
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Tue, 29 Sep 2015 15:01:34 +0200
parents truffle/com.oracle.truffle.sl.test/tests/Call.sl@9c8c0937da41
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13762
e34d5cca7496 Use source and expected output files to test Simple Language, instead of individual JUnit tests with the source and expected output as strings
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff changeset
1 function ret(a) { return a; }
e34d5cca7496 Use source and expected output files to test Simple Language, instead of individual JUnit tests with the source and expected output as strings
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff changeset
2 function dub(a) { return a * 2; }
e34d5cca7496 Use source and expected output files to test Simple Language, instead of individual JUnit tests with the source and expected output as strings
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff changeset
3 function inc(a) { return a + 1; }
e34d5cca7496 Use source and expected output files to test Simple Language, instead of individual JUnit tests with the source and expected output as strings
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff changeset
4 function dec(a) { return a - 1; }
e34d5cca7496 Use source and expected output files to test Simple Language, instead of individual JUnit tests with the source and expected output as strings
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff changeset
5 function call(f, v) { return f(v); }
e34d5cca7496 Use source and expected output files to test Simple Language, instead of individual JUnit tests with the source and expected output as strings
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff changeset
6
e34d5cca7496 Use source and expected output files to test Simple Language, instead of individual JUnit tests with the source and expected output as strings
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff changeset
7 function main() {
13821
b16ec83edc73 Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13762
diff changeset
8 println(ret(42));
b16ec83edc73 Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13762
diff changeset
9 println(dub(21));
b16ec83edc73 Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13762
diff changeset
10 println(inc(41));
b16ec83edc73 Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13762
diff changeset
11 println(dec(43));
b16ec83edc73 Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13762
diff changeset
12 println(call(ret, 42));
b16ec83edc73 Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13762
diff changeset
13 println(call(dub, 21));
b16ec83edc73 Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13762
diff changeset
14 println(call(inc, 41));
b16ec83edc73 Documentation and more refactoring of Simple Language
Christian Wimmer <christian.wimmer@oracle.com>
parents: 13762
diff changeset
15 println(call(dec, 43));
13762
e34d5cca7496 Use source and expected output files to test Simple Language, instead of individual JUnit tests with the source and expected output as strings
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff changeset
16 }