mise à jour des tests
This commit is contained in:
1
tests/fragment2/call.test_out
Normal file
1
tests/fragment2/call.test_out
Normal file
@@ -0,0 +1 @@
|
||||
one() = 1
|
||||
4
tests/fragment2/call.vsl
Normal file
4
tests/fragment2/call.vsl
Normal file
@@ -0,0 +1,4 @@
|
||||
PROTO INT one()
|
||||
FUNC VOID main() { PRINT "one() = ", one() }
|
||||
FUNC INT one() RETURN 1
|
||||
|
||||
1
tests/fragment2/call2.test_out
Normal file
1
tests/fragment2/call2.test_out
Normal file
@@ -0,0 +1 @@
|
||||
1+3 = 4
|
||||
4
tests/fragment2/call2.vsl
Normal file
4
tests/fragment2/call2.vsl
Normal file
@@ -0,0 +1,4 @@
|
||||
PROTO INT plus(x,y)
|
||||
FUNC VOID main() PRINT "1+3 = " ,plus(1,3)
|
||||
|
||||
FUNC INT plus(x,y) RETURN x+y
|
||||
14
tests/fragment2/call3expr.test_out
Normal file
14
tests/fragment2/call3expr.test_out
Normal file
@@ -0,0 +1,14 @@
|
||||
1+3 = 4
|
||||
1-3 = -2
|
||||
1*3 = 3
|
||||
1/3 = 0
|
||||
1+1 = 2
|
||||
1* (1+3) = 4
|
||||
1* 1+3 = 4
|
||||
5+2 = 7
|
||||
5-2 = 3
|
||||
5*2 = 10
|
||||
5/2 = 2
|
||||
5+1 = 6
|
||||
5* (5+2) = 35
|
||||
5* 5+2 = 27
|
||||
12
tests/fragment2/call3expr.vsl
Normal file
12
tests/fragment2/call3expr.vsl
Normal file
@@ -0,0 +1,12 @@
|
||||
PROTO VOID expr(x,y)
|
||||
FUNC VOID main() { expr(1,3) expr(5,2) }
|
||||
FUNC VOID expr(x,y) {
|
||||
PRINT x,"+",y," = ", x+y ,"\n"
|
||||
PRINT x,"-",y," = ", x-y ,"\n"
|
||||
PRINT x,"*",y," = ", x*y ,"\n"
|
||||
PRINT x,"/",y," = ", x/y ,"\n"
|
||||
PRINT x,"+",1," = ", x+1 ,"\n"
|
||||
PRINT x,"* (",x,"+",y,") = ", x*(x+y) ,"\n"
|
||||
PRINT x,"* ",x,"+",y," = ", x * x + y ,"\n"
|
||||
}
|
||||
|
||||
3
tests/fragment2/call4if.test_out
Normal file
3
tests/fragment2/call4if.test_out
Normal file
@@ -0,0 +1,3 @@
|
||||
2 est different de 1
|
||||
1 est different de 2
|
||||
1 est egal a 1
|
||||
7
tests/fragment2/call4if.vsl
Normal file
7
tests/fragment2/call4if.vsl
Normal file
@@ -0,0 +1,7 @@
|
||||
PROTO VOID compare(x,y)
|
||||
FUNC VOID main() { compare(2,1) compare(1,2) compare(1,1) }
|
||||
FUNC VOID compare(x,y) IF x-y THEN PRINT x, " est different de ",y,"\n"
|
||||
ELSE PRINT x, " est egal a ",y,"\n"
|
||||
FI
|
||||
|
||||
|
||||
1
tests/fragment2/proto1.test_ret
Normal file
1
tests/fragment2/proto1.test_ret
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
tests/fragment2/proto1.vsl
Normal file
2
tests/fragment2/proto1.vsl
Normal file
@@ -0,0 +1,2 @@
|
||||
PROTO INT main()
|
||||
FUNC INT main() RETURN 0
|
||||
1
tests/fragment2/proto2.test_out
Normal file
1
tests/fragment2/proto2.test_out
Normal file
@@ -0,0 +1 @@
|
||||
1+3 = 4
|
||||
5
tests/fragment2/proto2.vsl
Normal file
5
tests/fragment2/proto2.vsl
Normal file
@@ -0,0 +1,5 @@
|
||||
PROTO INT plus(x,y)
|
||||
|
||||
FUNC VOID main() PRINT "1+3 = ", plus(1,3)
|
||||
|
||||
FUNC INT plus(x,y) RETURN x+y
|
||||
Reference in New Issue
Block a user