示例#1
0
文件: test_t.py 项目: hermetique/dao
 def test4(self):
     eq_(teval('1+2;'), 3)
示例#2
0
文件: test_t.py 项目: chaosim/dao
 def test2_0(self):
   eq_(teval('+1 ; -1'), -1)
   eq_(teval('-123.5e-6; +1; -1'), -1)
   eq_(teval('"-1" ;  1'), 1)
示例#3
0
文件: test_t.py 项目: hermetique/dao
 def test2(self):
     eq_(teval('a; a;'), var('a'))
示例#4
0
文件: test_t.py 项目: hermetique/dao
 def test6(self):
     eq_(teval('i = 0; loop: i++; print i; if i==3: break'), None)
示例#5
0
文件: test_t.py 项目: hermetique/dao
 def test3(self):
     eq_(teval('fun a + (): print 1 a()'), None)
示例#6
0
文件: test_t.py 项目: hermetique/dao
 def test4(self):
     eq_(teval('case 1: of 1: print 1; of 2: print 2; else: print "other"'),
         None)
示例#7
0
文件: test_t.py 项目: hermetique/dao
 def test3(self):
     eq_(teval('i = 0; loop: print "loop";  i++ when i<3'), None)
示例#8
0
文件: test_t.py 项目: chaosim/dao
 def test1(self):
   eq_(teval('print 1'), None)
示例#9
0
文件: test_t.py 项目: chaosim/dao
 def test2(self):
   eq_(teval('let a = 1, b = 2 do: print a+b'), None)
示例#10
0
文件: test_t.py 项目: chaosim/dao
 def test5(self):
   eq_(teval('1+2*3;'), 7)
示例#11
0
文件: test_t.py 项目: chaosim/dao
 def test6(self):
   eq_(teval('a = 1; a--'), 0)
示例#12
0
文件: test_t.py 项目: chaosim/dao
 def test4(self):
   eq_(teval('1+2;'), 3)
示例#13
0
文件: test_t.py 项目: chaosim/dao
 def test3(self):
   eq_(teval('a = 1;'), 1)
   eq_(teval('a = b = 1;'), 1)
示例#14
0
文件: test_t.py 项目: chaosim/dao
 def test2(self):
   eq_(teval('a; a;'), var('a'))
示例#15
0
文件: test_t.py 项目: hermetique/dao
 def test6(self):
     eq_(teval('a = 1; a--'), 0)
示例#16
0
文件: test_t.py 项目: chaosim/dao
 def test3(self):
   eq_(teval('if 1: print 1; else: print "other"'), None)
示例#17
0
文件: test_t.py 项目: hermetique/dao
 def test2(self):
     eq_(teval('let a = 1, b = 2 do: print a+b'), None)
示例#18
0
文件: test_t.py 项目: chaosim/dao
 def test4(self):
   eq_(teval('case 1: of 1: print 1; of 2: print 2; else: print "other"'), None)
示例#19
0
文件: test_t.py 项目: hermetique/dao
 def test1(self):
     eq_(teval('loop: print "loop" by 3 times'), None)
示例#20
0
文件: test_t.py 项目: chaosim/dao
 def test5(self):
   eq_(teval('{1; print "a";}'), None)
示例#21
0
文件: test_t.py 项目: hermetique/dao
 def test5(self):
     eq_(teval('i = 0; while i<3: pass;  i++ '), None)
示例#22
0
文件: test_t.py 项目: chaosim/dao
 def test1(self):
   eq_(teval('loop: print "loop" by 3 times'), None)
示例#23
0
文件: test_t.py 项目: hermetique/dao
 def test1(self):
     eq_(teval('fun a: \n   (): print 1; \n   (x): print x \na()'), None)
示例#24
0
文件: test_t.py 项目: chaosim/dao
 def test2(self):
   eq_(teval('i = 0; loop: print "loop";  i++ until i==3'), None)
示例#25
0
文件: test_t.py 项目: hermetique/dao
 def test4(self):
     eq_(teval('fun - a/3'), None)
示例#26
0
文件: test_t.py 项目: chaosim/dao
 def test3(self):
   eq_(teval('i = 0; loop: print "loop";  i++ when i<3'), None)
示例#27
0
文件: test_t.py 项目: hermetique/dao
 def test2_0(self):
     eq_(teval('+1 ; -1'), -1)
     eq_(teval('-123.5e-6; +1; -1'), -1)
     eq_(teval('"-1" ;  1'), 1)
示例#28
0
文件: test_t.py 项目: chaosim/dao
 def test4(self):
   eq_(teval('i = 0; while i<3: print "loop";  i++'), None)
示例#29
0
文件: test_t.py 项目: hermetique/dao
 def test3(self):
     eq_(teval('a = 1;'), 1)
     eq_(teval('a = b = 1;'), 1)
示例#30
0
文件: test_t.py 项目: chaosim/dao
 def test5(self):
   eq_(teval('i = 0; while i<3: pass;  i++ '), None)
示例#31
0
文件: test_t.py 项目: hermetique/dao
 def test5(self):
     eq_(teval('1+2*3;'), 7)
示例#32
0
文件: test_t.py 项目: chaosim/dao
 def test6(self):
   eq_(teval('i = 0; loop: i++; print i; if i==3: break'), None)
示例#33
0
文件: test_t.py 项目: hermetique/dao
 def test1(self):
     eq_(teval('print 1'), None)
示例#34
0
文件: test_t.py 项目: chaosim/dao
 def test7(self):
   eq_(teval('i = 0; block: i++; print i; if i<3: redo'), None)
示例#35
0
文件: test_t.py 项目: hermetique/dao
 def test3(self):
     eq_(teval('if 1: print 1; else: print "other"'), None)
示例#36
0
文件: test_t.py 项目: chaosim/dao
 def test1(self):
   eq_(teval('fun a: \n   (): print 1; \n   (x): print x \na()'), None)
示例#37
0
文件: test_t.py 项目: hermetique/dao
 def test5(self):
     eq_(teval('{1; print "a";}'), None)
示例#38
0
文件: test_t.py 项目: chaosim/dao
 def test2(self):
   eq_(teval('fun a = (): print 1\n a()'), None)
示例#39
0
文件: test_t.py 项目: hermetique/dao
 def test2(self):
     eq_(teval('i = 0; loop: print "loop";  i++ until i==3'), None)
示例#40
0
文件: test_t.py 项目: chaosim/dao
 def test3(self):
   eq_(teval('fun a + (): print 1 a()'), None)
示例#41
0
文件: test_t.py 项目: hermetique/dao
 def test4(self):
     eq_(teval('i = 0; while i<3: print "loop";  i++'), None)
示例#42
0
文件: test_t.py 项目: chaosim/dao
 def test1(self):
   eq_(teval('-1'), -1)
   eq_(teval('-123.5e-6'), -0.0001235)
   eq_(teval('"-1"'), "-1")
示例#43
0
文件: test_t.py 项目: hermetique/dao
 def test1(self):
     eq_(teval('-1'), -1)
     eq_(teval('-123.5e-6'), -0.0001235)
     eq_(teval('"-1"'), "-1")
示例#44
0
文件: test_t.py 项目: chaosim/dao
 def test4(self):
   eq_(teval('fun a % (): print 1 a()'), None)
示例#45
0
文件: test_t.py 项目: hermetique/dao
 def test7(self):
     eq_(teval('i = 0; block: i++; print i; if i<3: redo'), None)
示例#46
0
文件: test_t.py 项目: chaosim/dao
 def test4(self):
   eq_(teval('fun - a/3'), None)
示例#47
0
文件: test_t.py 项目: hermetique/dao
 def test2(self):
     eq_(teval('fun a = (): print 1\n a()'), None)
示例#48
0
文件: test_t.py 项目: chaosim/dao
 def test5(self):
   eq_(teval('fun - a:()'), None)
示例#49
0
文件: test_t.py 项目: hermetique/dao
 def test4(self):
     eq_(teval('fun a % (): print 1 a()'), None)
示例#50
0
文件: test_t.py 项目: hermetique/dao
 def test1_2(self):
     eq_(teval('a'), var('a'))
示例#51
0
文件: test_t.py 项目: hermetique/dao
 def test5(self):
     eq_(teval('fun - a:()'), None)
示例#52
0
文件: test_t.py 项目: chaosim/dao
 def test1_2(self):
   eq_(teval('a'), var('a'))