Initial commit
This commit is contained in:
2
tests/testlevel2/level2assign.test_in
Normal file
2
tests/testlevel2/level2assign.test_in
Normal file
@@ -0,0 +1,2 @@
|
||||
7
|
||||
|
||||
1
tests/testlevel2/level2assign.test_out
Normal file
1
tests/testlevel2/level2assign.test_out
Normal file
@@ -0,0 +1 @@
|
||||
y vaut 7
|
||||
6
tests/testlevel2/level2assign.vsl
Normal file
6
tests/testlevel2/level2assign.vsl
Normal file
@@ -0,0 +1,6 @@
|
||||
FUNC VOID main() {
|
||||
INT x,y
|
||||
READ x
|
||||
y := x
|
||||
PRINT "y vaut ",y
|
||||
}
|
||||
1
tests/testlevel2/level2call.test_out
Normal file
1
tests/testlevel2/level2call.test_out
Normal file
@@ -0,0 +1 @@
|
||||
one() = 1
|
||||
4
tests/testlevel2/level2call.vsl
Normal file
4
tests/testlevel2/level2call.vsl
Normal file
@@ -0,0 +1,4 @@
|
||||
PROTO INT one()
|
||||
FUNC VOID main() { PRINT "one() = ", one() }
|
||||
FUNC INT one() RETURN 1
|
||||
|
||||
1
tests/testlevel2/level2call2.test_out
Normal file
1
tests/testlevel2/level2call2.test_out
Normal file
@@ -0,0 +1 @@
|
||||
1+3 = 4
|
||||
4
tests/testlevel2/level2call2.vsl
Normal file
4
tests/testlevel2/level2call2.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/testlevel2/level2expr.test_out
Normal file
14
tests/testlevel2/level2expr.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/testlevel2/level2expr.vsl
Normal file
12
tests/testlevel2/level2expr.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/testlevel2/level2if1.test_out
Normal file
3
tests/testlevel2/level2if1.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/testlevel2/level2if1.vsl
Normal file
7
tests/testlevel2/level2if1.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/testlevel2/level2proto.test_out
Normal file
1
tests/testlevel2/level2proto.test_out
Normal file
@@ -0,0 +1 @@
|
||||
1+3 = 4
|
||||
5
tests/testlevel2/level2proto.vsl
Normal file
5
tests/testlevel2/level2proto.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
|
||||
2
tests/testlevel2/level2read.test_in
Normal file
2
tests/testlevel2/level2read.test_in
Normal file
@@ -0,0 +1,2 @@
|
||||
3
|
||||
|
||||
1
tests/testlevel2/level2read.test_out
Normal file
1
tests/testlevel2/level2read.test_out
Normal file
@@ -0,0 +1 @@
|
||||
Le nombre lu est 3
|
||||
5
tests/testlevel2/level2read.vsl
Normal file
5
tests/testlevel2/level2read.vsl
Normal file
@@ -0,0 +1,5 @@
|
||||
FUNC VOID main() {
|
||||
INT x
|
||||
READ x
|
||||
PRINT "Le nombre lu est ", x
|
||||
}
|
||||
Reference in New Issue
Block a user