Ticket #8: deprecFixTests.patch
File deprecFixTests.patch, 5.9 KB (added by hopscc, 17 years ago) |
---|
patch for changes to Testfiles (avoid deprec warning) |
-
500-dynamic/126-dynamic-statements.cobra
72 72 for dk in da : db 73 73 assert dk > 0 and dk >= da and dk < db 74 74 75 for x = 2 ..1075 for x in 2:10 76 76 assert x >= 2 and x <= 10 77 for xq = 2 ..1077 for xq in 2:10 78 78 assert xq >= 2 and x <= 10 79 79 80 80 da as dynamic = 1 81 for di = da ..1081 for di in da:10 82 82 assert di > 0 and di < 10 83 83 db as dynamic = 10 84 for dj = 1 ..db84 for dj in 1:db 85 85 assert dj > 0 and dj < db 86 for dk = da ..db86 for dk in da:db 87 87 assert dk > 0 and dk >= da and dk < db 88 88 89 89 -
120-classes/804-test.cobra
18 18 assert c==c'a' 19 19 body 20 20 sb as StringBuilder = StringBuilder() 21 for i as int = 0 ..length21 for i as int in 0:length 22 22 CobraCore.noOp(i) 23 23 c as char = alphabet[_random.next(alphabet.length)] 24 24 sb.append(c) -
240-generics/100-use-generics-collections/122-use-cobra-set.cobra
29 29 30 30 # test that 'in' is fast 31 31 x = 10000 32 for i = 0 ..x32 for i in 0:x 33 33 s.add(i) 34 34 t.add(i) 35 35 x -= 1 … … 37 37 reps = 1000 38 38 39 39 start = DateTime.now 40 for n = 0 ..reps40 for n in 0:reps 41 41 assert x in s 42 42 assert x in s 43 43 assert x in s … … 46 46 setTest = DateTime.now.subtract(start).totalSeconds 47 47 48 48 start = DateTime.now 49 for n = 0 ..reps49 for n in 0:reps 50 50 assert x in t 51 51 assert x in t 52 52 assert x in t … … 66 66 # same thing, but 'not in' 67 67 x += 1 68 68 start = DateTime.now 69 for n = 0 ..reps69 for n in 0:reps 70 70 assert x not in s 71 71 assert x not in s 72 72 assert x not in s … … 75 75 setTest = DateTime.now.subtract(start).totalSeconds 76 76 77 77 start = DateTime.now 78 for n = 0 ..reps78 for n in 0:reps 79 79 assert x not in t 80 80 assert x not in t 81 81 assert x not in t -
100-basics/140-break.cobra
12 12 assert x==0 13 13 14 14 x = 1 15 for i as int = 1 ..1015 for i as int in 1:10 16 16 break 17 17 x = i 18 18 assert x==1 -
100-basics/120-for-numeric.cobra
13 13 14 14 # the usual for numeric: 15 15 count = 0 16 for x as int = 0 ..10016 for x as int in 0:100 17 17 r = x 18 18 count += 1 19 19 assert x==100 … … 21 21 22 22 # with a ++ 23 23 count = 0 24 for x as int = 0 .. 100 ++224 for x as int in 0:100:2 25 25 r = x 26 26 count += 1 27 27 assert r==98 … … 29 29 assert count==50 30 30 31 31 count = 0 32 for x as int = 1 .. 100 ++232 for x as int in 1:100:2 33 33 r = x 34 34 count += 1 35 35 assert r==99 … … 37 37 38 38 # reverse order 39 39 count = 0 40 for x = 100 .. 0 --140 for x in 100:0:-1 41 41 r = x 42 42 count += 1 43 43 assert r==1, r … … 45 45 46 46 # by 2 47 47 count = 0 48 for x = 100 .. 0 --248 for x in 100:0:-2 49 49 r = x 50 50 count += 1 51 51 assert r==2 … … 56 56 def more 57 57 i = 1 58 58 # reuse a local 59 for i = 1 ..1059 for i in 1:10 60 60 assert i 61 61 assert i == 10 62 62 … … 66 66 def foo(x as int) 67 67 assert x == 5 68 68 # reuse an arg: 69 for x = 1 ..1069 for x in 1:10 70 70 assert x 71 71 assert x == 10 72 72 … … 75 75 def bar 76 76 assert _b == 0 77 77 # reuse a class var: 78 for _b = 1 ..1078 for _b in 1:10 79 79 assert _b 80 80 assert _b == 10 -
320-misc-two/402-implement-IEnumerable.cobra
5 5 6 6 def init(max as int) 7 7 _numbers = List<of int>() 8 for i = 0 ..max8 for i in 0:max 9 9 _numbers.add(i) 10 10 11 11 def getEnumerator as IEnumerator<of int> -
110-basics-two/800-arrays/100-single-dim-array.cobra
9 9 for i as int in numbers 10 10 assert i==0 11 11 12 for i = 0 ..numbers.length12 for i in 0:numbers.length 13 13 assert numbers[i]==0 14 14 numbers[i] = i 15 15 assert numbers[i]==i -
300-type-inference/140-for.cobra
3 3 def main 4 4 is shared 5 5 6 for i = 0 ..106 for i in 0:10 7 7 assert i < 10 8 8 assert i==10 9 9 10 10 n = 10 11 for i = 0 ..n11 for i in 0:n 12 12 assert i < n 13 13 14 14 for arg in CobraCore.commandLineArgs -
300-type-inference/142-for.cobra
4 4 5 5 i = 1 # declaring i before using it in a for loop used to cause a false error about UnknownType 6 6 7 for i = 0 ..107 for i in 1:10 8 8 assert i < 10