@@ -6,87 +6,87 @@ println ("---------------------- List Tests ------------------------")
66setColor ("white")
77
88testUtils.beginTests ("")
9- a = { 1,2,3,4} ;
9+ a = [ 1,2,3,4] ;
1010 a = 1;
1111 testUtils.runtestTrue(a == 1);
1212
13- testUtils.runtestTrue({} == {} );
14- testUtils.runtestTrue({1} == {1} );
15- testUtils.runtestTrue({ 1,2,3} == { 1,2,3} );
16- testUtils.runtestTrue({ 1,2,3} + 4 == { 1,2,3,4} );
17- testUtils.runtestTrue({ 1,2,3} + 3.14 == { 1,2,3,3.14} );
13+ testUtils.runtestTrue([] == [] );
14+ testUtils.runtestTrue([1] == [1] );
15+ testUtils.runtestTrue([ 1,2,3] == [ 1,2,3] );
16+ testUtils.runtestTrue([ 1,2,3] + 4 == [ 1,2,3,4] );
17+ testUtils.runtestTrue([ 1,2,3] + 3.14 == [ 1,2,3,3.14] );
1818
19- testUtils.runtestTrue({ 1,2,3} + True == { 1,2,3,True} );
20- testUtils.runtestTrue({ 1,2,3} + "string" == { 1,2,3,"string"} );
19+ testUtils.runtestTrue([ 1,2,3] + True == [ 1,2,3,True] );
20+ testUtils.runtestTrue([ 1,2,3] + "string" == [ 1,2,3,"string"] );
2121
22- testUtils.runtestTrue({ 1,2,3} + {4} == { 1,2,3,4} );
23- testUtils.runtestTrue({ 1,2,3} + {{4}} == { 1,2,3,{4}} );
22+ testUtils.runtestTrue([ 1,2,3] + [4] == [ 1,2,3,4] );
23+ testUtils.runtestTrue([ 1,2,3] + [[4]] == [ 1,2,3,[4]] );
2424
25- testUtils.runtestTrue ({ 1,2,3} + 3.14 == { 1,2,3,3.14} );
26- testUtils.runtestTrue ({ 1,2,3} + True == { 1,2,3,True} );
25+ testUtils.runtestTrue ([ 1,2,3] + 3.14 == [ 1,2,3,3.14] );
26+ testUtils.runtestTrue ([ 1,2,3] + True == [ 1,2,3,True] );
2727
28- testUtils.runtestTrue ({ 1,2,3} + { "string"} == { 1,2,3,"string"} );
28+ testUtils.runtestTrue ([ 1,2,3] + [ "string"] == [ 1,2,3,"string"] );
2929
30- testUtils.runtestTrue ({ 1,2,3} + { 4,True,2.81,"string"} == { 1,2,3,4,True,2.81,"string"} );
30+ testUtils.runtestTrue ([ 1,2,3] + [ 4,True,2.81,"string"] == [ 1,2,3,4,True,2.81,"string"] );
3131
32- testUtils.runtestTrue ({ 1,2,3} + {{ 4,True,2.81,"string"}} == { 1,2,3,{ 4,True,2.81,"string"}} );
32+ testUtils.runtestTrue ([ 1,2,3] + [[ 4,True,2.81,"string"]] == [ 1,2,3,[ 4,True,2.81,"string"]] );
3333
34- testUtils.runtestTrue ({ 1,2,3} + {{ 4,5,{6,{7}}}} == { 1,2,3,{ 4,5,{6,{7}}}} );
34+ testUtils.runtestTrue ([ 1,2,3] + [[ 4,5,[6,[7]]]] == [ 1,2,3,[ 4,5,[6,[7]]]] );
3535testUtils.endTests()
3636
3737
3838testUtils.beginTests ("")
39- a = {1} ;
40- testUtils.runtestTrue (3*a == { 1,1,1} );
39+ a = [1] ;
40+ testUtils.runtestTrue (3*a == [ 1,1,1] );
4141
42- a = { 1,2} ;
43- testUtils.runtestTrue (3*a == { 1,2,1,2,1,2} );
42+ a = [ 1,2] ;
43+ testUtils.runtestTrue (3*a == [ 1,2,1,2,1,2] );
4444
45- a = {1,{2}} ;
46- testUtils.runtestTrue (a*3 == {1,{2} ,1,{2} ,1,{2}} );
45+ a = [1,[2]] ;
46+ testUtils.runtestTrue (a*3 == [1,[2] ,1,[2] ,1,[2]] );
4747
4848 a = True;
49- alist = { 1,2,3} ;
49+ alist = [ 1,2,3] ;
5050 alist[1] = a;
51- testUtils.runtestTrue (alist == { 1, True, 3} );
51+ testUtils.runtestTrue (alist == [ 1, True, 3] );
5252testUtils.endTests()
5353
5454testUtils.beginTests ("")
55- alist = { 1,2,3,4} ;
55+ alist = [ 1,2,3,4] ;
5656 testUtils.runtestTrue (alist[1] == 2);
5757 testUtils.runtestTrue (alist[2] == 3);
5858
59- alist = { 1,2,3,{ 4,5},6} ;
60- testUtils.runtestTrue (alist[3] == { 4,5} );
59+ alist = [ 1,2,3,[ 4,5],6] ;
60+ testUtils.runtestTrue (alist[3] == [ 4,5] );
6161
62- alist = { 1,2,3,{ 4,5},6} ;
62+ alist = [ 1,2,3,[ 4,5],6] ;
6363 alist[0] = 99;
6464 testUtils.runtestTrue (alist[0] == 99);
6565
66- alist = { 1,2,3,{ 4,5},6} ;
67- alist[0] = { "ab","xy"} ;
68- testUtils.runtestTrue (alist[0] == { "ab","xy"} );
66+ alist = [ 1,2,3,[ 4,5],6] ;
67+ alist[0] = [ "ab","xy"] ;
68+ testUtils.runtestTrue (alist[0] == [ "ab","xy"] );
6969
70- a = { 3,4} ;
71- a = { 1,2} ;
72- a = { 1,2,3,4,5} ;
70+ a = [ 3,4] ;
71+ a = [ 1,2] ;
72+ a = [ 1,2,3,4,5] ;
7373 testUtils.runtestTrue (a[1] + a[3] == 6);
7474
75- a = { 1,2,{3,{ 4,5}}} ;
76- testUtils.runtestTrue (a[2,1] == { 4,5} );
75+ a = [ 1,2,[3,[ 4,5]]] ;
76+ testUtils.runtestTrue (a[2,1] == [ 4,5] );
7777 a[2,1,0] = 99;
78- testUtils.runtestTrue (a == { 1,2,{3,{ 99,5}}} );
78+ testUtils.runtestTrue (a == [ 1,2,[3,[ 99,5]]] );
7979testUtils.endTests()
8080
8181testUtils.beginTests ("")
8282 // Memmory leak tests for multipying lists
83- a = { 1,2,3} ;
83+ a = [ 1,2,3] ;
8484 b = 3*a;
85- testUtils.runtestTrue (b == { 1,2,3,1,2,3,1,2,3} );
85+ testUtils.runtestTrue (b == [ 1,2,3,1,2,3,1,2,3] );
8686
87- a = { 1,2,3,{ 7,8,9,{ 56,78}}} ;
87+ a = [ 1,2,3,[ 7,8,9,[ 56,78]]] ;
8888 x = a[3,3];
89- testUtils.runtestTrue (x == { 56,78} );
89+ testUtils.runtestTrue (x == [ 56,78] );
9090testUtils.endTests()
9191
9292
@@ -95,9 +95,9 @@ testUtils.beginTests ("")
9595// --------------------------------------------------------
9696// Test period syntax and index of lists containing methods
9797//println ("\nList containing methods")
98- r = { math.sin (30), math.cos (30), math.tan (30)} ;
98+ r = [ math.sin (30), math.cos (30), math.tan (30)] ;
9999
100- x = { math.sin, math.cos, math.tan} ;
100+ x = [ math.sin, math.cos, math.tan] ;
101101
102102testUtils.runtestTrue (r[0] == x[0](30));
103103testUtils.runtestTrue (r[1] == x[1](30));
@@ -113,7 +113,7 @@ testUtils.beginTests ("")
113113 // And user defined funtions
114114 function test (x) return x*x; end
115115
116- x = { test}
116+ x = [ test]
117117 testUtils.runtestTrue (3*3 == x[0](3));
118118
119119 function runtest (fcn, x)
0 commit comments