Add unit tests for mmd and guarded mmd

This commit is contained in:
Jonathan Turner 2009-07-09 17:07:29 +00:00
parent 57aeacab2e
commit fb286b91ea
4 changed files with 36 additions and 0 deletions

20
unittests/mmd1.chai Normal file
View File

@ -0,0 +1,20 @@
def bob(x, y, z) {
x + y + z
}
def bob(x, y) {
x - y
}
def bob(x) {
-x
}
def bob() {
10
}
print(bob())
print(bob(5))
print(bob(5,6))
print(bob(5,6,7))

4
unittests/mmd1.txt Normal file
View File

@ -0,0 +1,4 @@
10
-5
-1
18

9
unittests/mmd2.chai Normal file
View File

@ -0,0 +1,9 @@
def bob(x, y) : x > 10 { x - y }
def bob(x, y) : x > 5 { x - y + 10 }
def bob(x, y) { x + y }
print(bob(3, 4))
print(bob(6, 7))
print(bob(11, 12))

3
unittests/mmd2.txt Normal file
View File

@ -0,0 +1,3 @@
7
9
-1