tests to folder

master
Clyne Sullivan 7 years ago
parent b761569b3a
commit dab3b1d51e

@ -0,0 +1,18 @@
# test1
# arithmetic tests
# looking for proper basic function, respect for order of ops,
# and respect for parentheses
print(2 + 5)
print(14 - 9)
print(3 * 8 + 3)
print(9 - 3 / 2)
print(3 * (8 + 3))
print((9 - 3) / 2)
print((4 + 5) * ((9 - 1) + 3))
print(5 - 3 + 4)
print("")
print(-4)
print(-4 + -3)
print(-8+13)
print(4- -9)

@ -0,0 +1,3 @@
a = "a"
append(append(append(a, "llo"), " mate!"), 37)
print(a)

@ -0,0 +1,17 @@
# test2
# variable and function tests
# show variable recognition and proper c-function handling
print(a * 1)
print(3 + b)
print(a = 5)
print(a * 1)
print(c = 4)
print(a / c)
print(b = 2)
print(d = 8)
print(d + (e = 4))

@ -0,0 +1,25 @@
# test3
# verify builtin functions, conditionals and such
a = 5
func(checka) {
if (a == 5) {
print("a == 5")
} else {
print("a != 5")
}
}
checka()
print("Increment a...")
a = a + 1
checka()
d = 0
while (d < 20) {
print(d)
d = d + 1
}

@ -0,0 +1,13 @@
# test4
# find memory leaks
#x = 4
#y = solve("x-2")
#print(y)
#print("")
#y = solve("3*x")
#print(y)
y = solve("-")
#y = solve("x*x*x*x*x")

@ -0,0 +1,10 @@
# test5
# solver test
while (1) {
input = gets
if (input == "exit") {
exit
}
print(solve(input))
}

@ -0,0 +1,10 @@
# test6
# used to fix memory leak in setting defined strings
test = "hello"
test = "fail"
a = test
test = "acd"
print(a)
print(test)

@ -0,0 +1,14 @@
j = 6
func(test) {
i = 0
while (i < 10) {
i = i + 1
}
j = 15
}
print(i)
print(" ")
print(j)

@ -0,0 +1,23 @@
array(a, 10)
i = 0
while (i < 10) {
a.i = i * 2
i = i + 1
}
i = 0
while (i < 10) {
print(a.i)
i = i + 1
}
a.20 = 143
print(a.20)
print(a.19)
print("Strings:")
str = "Hello!"
print(str.0)
print(str.2)
print(str.4)

@ -0,0 +1,16 @@
x = 9
print(3x)
print(2x + 5)
print(x - 9x)
print(5 + (3x))
print((x - 4 * 5)2)
y = 8
# 2*x*y = 144
print(x2y)
print(2xy)
print(2x*y)
A = 5
B = 9
print("")
print(2AB)
Loading…
Cancel
Save