Skip to content

Instantly share code, notes, and snippets.

@joelgallant
Last active December 22, 2015 18:59
Show Gist options
  • Save joelgallant/6516787 to your computer and use it in GitHub Desktop.
Save joelgallant/6516787 to your computer and use it in GitHub Desktop.
Tests to ensure gordian is functioning correctly after a patch. Does not do absolutely everything, but it is sufficient for a release.
print('Should print 1')
print(x = 1)
print('Should print 2')
print(2)
print('Should print 3')
print(3.0)
print('Should print 1.000000000001')
print(1 / 0.999999999999)
print('Should print \'')
print('\'')
print('Should print \"')
print('\"')
print('Should print a tab')
print('\tend')
print('Should print a newline')
print('\nend')
print('Should print list of elements')
print({'list', 'of', 'elements'})
print('Should print null')
print(null)
class A:
x = 'x'
def f():
print(x)
fi
fi
print('Should print class')
print(A)
print('Should print instance')
print([A])
print('Should print x')
print([A].x)
class B(A):
x = 'i'
fi
print('Should print i')
print([B].x)
print('Should print x')
print([B].parent.x)
print('Should print x')
[B].f()
print('Should print x')
[B].parent.f()
x = [B].parent
print('Should print x')
print(x.x)
class F:
e = 13
fi
i = [F].e + 1
print('Should print 14')
print(i)
class D:
i = 1
fi
d = [D].i
d.i = 2
print('Should print 2')
print(d.i)
print('Should print false')
print(!true)
print('Should print true')
print(!false)
print('Should print 3')
print(int(3.999))
print('Should print 3.999')
print(num(3.999))
print('Should print true')
print(bool('True'))
print('Should print 12')
print(str(24 / 2))
def foo(X):
return(X)
fi
print('Should print 3')
print(foo(3))
class G:
x = 13
fi
g = [G]
g.x++
print('Should print 14')
print(g.x)
print('Should print true')
print(13 == 13.0)
print(13 != 12.9)
print(13 <= 13.01)
print(13 >= 12.09)
print('Should print ' + 37.5)
print((15 / 2) * 5 + (4 % 2))
print('Should print 3.6')
print((2 + 2) / 6 + 3)
print('Should print 0.6')
print((4.6 % 2) * (5 % 2))
print('Should print 10.5')
print((3 / 2) * 2 + (3 / 2 + (2 + 4)))
print('Should print 3')
if('e' == 'e'):
print(3)
fi
print('Should print 10')
x = 0
while(x < 10):
x++
fi
print(x)
print('Should print 12')
x = 0
for(12):
x++
fi
print(x)
print('Should print from 0 to 3')
count(x, 0, 3):
print(x)
fi
print('Should print 1, 2, 3')
thread:
sleep(20)
print(3)
fi
thread:
sleep(10)
print(2)
fi
thread:
print(1)
fi
sleep(30)
print('Should print an error')
try:
as
fi
sleep(50)
def w(x, i, a):
return(x * i * a)
fi
print('Should print 30')
print(w(1, 2, 15))
x = 1
scope:
x = 14
delete('x')
fi
print('Should print 14')
print(x)
class R:
one = 1
two = 2
three = 3
four = 4
fi
one = 4
class W(R):
one = 2
two = parent.two
three = super.one
four = 5
fi
print('Should print 2')
print([W].one)
print('Should print 1')
print([W].parent.one)
print('Should print 2')
print([W].two)
print('Should print 4')
print([W].three)
print('Tests finished')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment