mise à jour des tests
This commit is contained in:
1
tests/fragment1/assign1.test_ret
Normal file
1
tests/fragment1/assign1.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
5
tests/fragment1/assign1.vsl
Normal file
5
tests/fragment1/assign1.vsl
Normal file
@@ -0,0 +1,5 @@
|
||||
FUNC INT main() {
|
||||
INT x
|
||||
x := 1
|
||||
RETURN x
|
||||
}
|
||||
1
tests/fragment1/assign2.test_ret
Normal file
1
tests/fragment1/assign2.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
6
tests/fragment1/assign2.vsl
Normal file
6
tests/fragment1/assign2.vsl
Normal file
@@ -0,0 +1,6 @@
|
||||
FUNC INT main() {
|
||||
INT x, y
|
||||
x := 1
|
||||
y := x
|
||||
RETURN y
|
||||
}
|
||||
1
tests/fragment1/block.test_ret
Normal file
1
tests/fragment1/block.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
tests/fragment1/block.vsl
Normal file
2
tests/fragment1/block.vsl
Normal file
@@ -0,0 +1,2 @@
|
||||
FUNC INT main() { RETURN 0 }
|
||||
|
||||
1
tests/fragment1/decl.test_ret
Normal file
1
tests/fragment1/decl.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
2
|
||||
4
tests/fragment1/decl.vsl
Normal file
4
tests/fragment1/decl.vsl
Normal file
@@ -0,0 +1,4 @@
|
||||
FUNC INT main() {
|
||||
INT x
|
||||
RETURN 2
|
||||
}
|
||||
1
tests/fragment1/hello_world.test_out
Normal file
1
tests/fragment1/hello_world.test_out
Normal file
@@ -0,0 +1 @@
|
||||
Hello World
|
||||
4
tests/fragment1/hello_world.vsl
Normal file
4
tests/fragment1/hello_world.vsl
Normal file
@@ -0,0 +1,4 @@
|
||||
FUNC VOID main() {
|
||||
PRINT "Hello World"
|
||||
}
|
||||
|
||||
1
tests/fragment1/if1.test_ret
Normal file
1
tests/fragment1/if1.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
2
tests/fragment1/if1.vsl
Normal file
2
tests/fragment1/if1.vsl
Normal file
@@ -0,0 +1,2 @@
|
||||
FUNC INT main() IF 1 THEN RETURN 1 FI
|
||||
|
||||
1
tests/fragment1/if2.test_ret
Normal file
1
tests/fragment1/if2.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
2
tests/fragment1/if2.vsl
Normal file
2
tests/fragment1/if2.vsl
Normal file
@@ -0,0 +1,2 @@
|
||||
FUNC INT main() IF 1 THEN RETURN 1 ELSE RETURN 0 FI
|
||||
|
||||
1
tests/fragment1/print1.test_out
Normal file
1
tests/fragment1/print1.test_out
Normal file
@@ -0,0 +1 @@
|
||||
Hello
|
||||
1
tests/fragment1/print1.vsl
Normal file
1
tests/fragment1/print1.vsl
Normal file
@@ -0,0 +1 @@
|
||||
FUNC VOID main() PRINT "Hello"
|
||||
1
tests/fragment1/print2.test_out
Normal file
1
tests/fragment1/print2.test_out
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
2
tests/fragment1/print2.vsl
Normal file
2
tests/fragment1/print2.vsl
Normal file
@@ -0,0 +1,2 @@
|
||||
FUNC VOID main() PRINT 1
|
||||
|
||||
1
tests/fragment1/print3.test_out
Normal file
1
tests/fragment1/print3.test_out
Normal file
@@ -0,0 +1 @@
|
||||
1 = 1
|
||||
2
tests/fragment1/print3.vsl
Normal file
2
tests/fragment1/print3.vsl
Normal file
@@ -0,0 +1,2 @@
|
||||
FUNC VOID main() PRINT "1 = ", 1
|
||||
|
||||
8
tests/fragment1/print4.test_out
Normal file
8
tests/fragment1/print4.test_out
Normal file
@@ -0,0 +1,8 @@
|
||||
5+7 = 12
|
||||
5-7 = -2
|
||||
5*7 = 35
|
||||
5/7 = 0
|
||||
5+1 = 6
|
||||
5* (5+7) = 60
|
||||
5* 5+7 = 32
|
||||
-2 = -2
|
||||
11
tests/fragment1/print4.vsl
Normal file
11
tests/fragment1/print4.vsl
Normal file
@@ -0,0 +1,11 @@
|
||||
FUNC VOID main() {
|
||||
PRINT 5,"+",7," = ", 5+7 ,"\n"
|
||||
PRINT 5,"-",7," = ", 5-7 ,"\n"
|
||||
PRINT 5,"*",7," = ", 5*7 ,"\n"
|
||||
PRINT 5,"/",7," = ", 5/7 ,"\n"
|
||||
PRINT 5,"+",1," = ", 5+1 ,"\n"
|
||||
PRINT 5,"* (",5,"+",7,") = ", 5*(5+7) ,"\n"
|
||||
PRINT 5,"* ",5,"+",7," = ", 5 * 5 + 7 ,"\n"
|
||||
PRINT "-2 = ", -2
|
||||
}
|
||||
|
||||
2
tests/fragment1/read0.test_in
Normal file
2
tests/fragment1/read0.test_in
Normal file
@@ -0,0 +1,2 @@
|
||||
3
|
||||
|
||||
1
tests/fragment1/read0.test_out
Normal file
1
tests/fragment1/read0.test_out
Normal file
@@ -0,0 +1 @@
|
||||
Le nombre lu est 3
|
||||
5
tests/fragment1/read0.vsl
Normal file
5
tests/fragment1/read0.vsl
Normal file
@@ -0,0 +1,5 @@
|
||||
FUNC VOID main() {
|
||||
INT x
|
||||
READ x
|
||||
PRINT "Le nombre lu est ", x
|
||||
}
|
||||
2
tests/fragment1/read1.test_in
Normal file
2
tests/fragment1/read1.test_in
Normal file
@@ -0,0 +1,2 @@
|
||||
7
|
||||
|
||||
1
tests/fragment1/read1.test_out
Normal file
1
tests/fragment1/read1.test_out
Normal file
@@ -0,0 +1 @@
|
||||
y vaut 7
|
||||
6
tests/fragment1/read1.vsl
Normal file
6
tests/fragment1/read1.vsl
Normal file
@@ -0,0 +1,6 @@
|
||||
FUNC VOID main() {
|
||||
INT x,y
|
||||
READ x
|
||||
y := x
|
||||
PRINT "y vaut ",y
|
||||
}
|
||||
3
tests/fragment1/read2.test_in
Normal file
3
tests/fragment1/read2.test_in
Normal file
@@ -0,0 +1,3 @@
|
||||
2
|
||||
7
|
||||
|
||||
1
tests/fragment1/read2.test_out
Normal file
1
tests/fragment1/read2.test_out
Normal file
@@ -0,0 +1 @@
|
||||
x vaut 2 et y vaut 7
|
||||
5
tests/fragment1/read2.vsl
Normal file
5
tests/fragment1/read2.vsl
Normal file
@@ -0,0 +1,5 @@
|
||||
FUNC VOID main() {
|
||||
INT x,y
|
||||
READ x, y
|
||||
PRINT "x vaut ",x," et y vaut ",y
|
||||
}
|
||||
1
tests/fragment1/sequence.test_out
Normal file
1
tests/fragment1/sequence.test_out
Normal file
@@ -0,0 +1 @@
|
||||
tototiti
|
||||
3
tests/fragment1/sequence.vsl
Normal file
3
tests/fragment1/sequence.vsl
Normal file
@@ -0,0 +1,3 @@
|
||||
FUNC VOID main() { PRINT "toto" PRINT "titi" }
|
||||
|
||||
|
||||
1
tests/fragment1/while1.test_ret
Normal file
1
tests/fragment1/while1.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
tests/fragment1/while1.vsl
Normal file
2
tests/fragment1/while1.vsl
Normal file
@@ -0,0 +1,2 @@
|
||||
FUNC INT main() WHILE 1 DO RETURN 0 DONE
|
||||
|
||||
1
tests/fragment1/while2.test_ret
Normal file
1
tests/fragment1/while2.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
84
|
||||
10
tests/fragment1/while2.vsl
Normal file
10
tests/fragment1/while2.vsl
Normal file
@@ -0,0 +1,10 @@
|
||||
FUNC INT main() {
|
||||
INT x, y x :=
|
||||
42 y:=0
|
||||
WHILE x DO {
|
||||
x := x - 1
|
||||
y := y + 2
|
||||
} DONE
|
||||
RETURN y
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user