8000 more tests · repos-javascript-compilers/JSX@ab7c4a3 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit ab7c4a3

Browse files
committed
more tests
1 parent 02149ff commit ab7c4a3

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

t/compile_and_run/009.callfunc.jsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*EXPECTED
2+
1
3+
1
4+
2
5+
3
6+
5
7+
8
8+
13
9+
*/
10+
class Test {
11+
static function fib(n : number) : number {
12+
if (n <= 2)
13+
return 1;
14+
else
15+
return Test.fib(n - 1) + Test.fib(n - 2);
16+
}
17+
static function run() : void {
18+
log Test.fib(1);
19+
log Test.fib(2);
20+
log Test.fib(3);
21+
log Test.fib(4);
22+
log Test.fib(5);
23+
log Test.fib(6);
24+
log Test.fib(7);
25+
}
26+
}

t/compile_and_run/010.condop.jsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*EXPECTED
2+
1
3+
1
4+
2
5+
3
6+
5
7+
8
8+
13
9+
*/
10+
class Test {
11+
static function fib(n : number) : number {
12+
return n <= 2 ? 1 : Test.fib(n - 1) + Test.fib(n - 2);
13+
}
14+
static function run() : void {
15+
log Test.fib(1);
16+
log Test.fib(2);
17+
log Test.fib(3);
18+
log Test.fib(4);
19+
log Test.fib(5);
20+
log Test.fib(6);
21+
log Test.fib(7);
22+
}
23+
}

0 commit comments

Comments
 (0)
0