pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:8410:   test_eq(([0:'f',1:'o',2:'o'])[2],'o')   test_eq(([0:'f',1:'o',2:'o'])[random(0)+3],0)   test_eq(([0:'f',1:'o',2:'o'])[random(0)-1],0)   test_eq((<'f','o','o'>)['o'],1)   test_eq((<'f','o','o'>)['f'],1)   test_eq((<'f','o','o'>)[random(0)+'b'],0)   test_eq((<'f','o','o'>)[-1],0)      test_eq([[class Z { mixed `->(mixed x) { return this_object()[x]; } int foo() { return 1; }}()->foo()]],1)    + // Test some indexing opcodes. + test_eval_error([[return ({1})[1];]]) + test_eval_error([[int i = 1; return ({1})[i];]]) + test_eval_error([[array a = ({ 1 }); return a[1];]]) + test_eval_error([[array a = ({ 1 }); int i = 1; return a[i];]]) +    // index assigning   test_any(mixed a=({1}); a[0]=2; return equal(a,({2})),1)   test_any(mixed a=(<1>); a[1]=2; return equal(a,(<1>)),1)   test_any(mixed a=(<1>); a[0]=2; return equal(a,(<1,0>)),1)   test_any(mixed a=(<1>); a[1]=0; return equal(a,(<>)),1)   test_any(mixed a=(<1>); a[0]=0; return equal(a,(<1>)),1)   test_any(mixed a=([1:1]); a[0]=0; return equal(a,([1:1,0:0])),1)   test_any(mixed a=([1:1]); a[1]=0; return equal(a,([1:0])),1)   test_any(mixed a="hej"; a[1]='o'; return a,"hoj")   test_do( string x=" "*73; x[64]=1; x[65]=1; )