# for expression over numeric range class ForExprNum def main is shared a = for i in [1, 2, 3] get i*10 assert a == [10, 20, 30] a = for i in 10 get i assert a == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] a = for i in 10 where i>5 get i assert a == [6, 7, 8, 9] max = 20 am = for i in max where i>15 get i assert am == [16, 17, 18, 19] b = for i in 3 : 6 get i assert b == [3, 4, 5] b = for i in 3 : 6 where i>=4 get i+1 assert b == [5, 6] c = for i in 3 : 6 : 2 get i assert c == [3, 5] c = for i in 3 : 8 : 2 where i>=4 get i+1 assert c == [6, 8] c = for i in 3 : 8 : 5 where i>=4 get i-10 assert c == [] c = for i in 8 : 5 : -1 get i assert c == [8, 7, 6] c = for i in 8 : 5 : -2 get i assert c == [8, 6] t = List() for i in 8 : 5 : -1 t.add(i) t = List() for i in 8 : 5 : -2 t.add(i) # Non terminating expect IndexOutOfRangeException d = for j in 8 : 5 get i CobraCore.noOp(d) # Non terminating expect IndexOutOfRangeException d = for j in 5 : 8 : -1 get i CobraCore.noOp(d)