コード例 #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'))