Branch: Tag:

1998-02-24

1998-02-24 23:01:36 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

lots of changes

Rev: src/ChangeLog:1.136
Rev: src/language.yacc:1.60
Rev: src/las.c:1.52
Rev: src/operators.c:1.26
Rev: src/peep.in:1.11
Rev: src/pike_types.c:1.33
Rev: src/program.c:1.63
Rev: src/program.h:1.32
Rev: src/signal_handler.c:1.32
Rev: src/testsuite.in:1.74
Rev: src/version.c:1.28

1: - test_true([["$Id: testsuite.in,v 1.73 1998/02/24 17:30:54 grubba Exp $"]]) + test_true([["$Id: testsuite.in,v 1.74 1998/02/24 23:01:35 hubbe Exp $"]])   test_eq(1e1,10.0)   test_eq(1E1,10.0)   test_eq(1e+1,10.0)
6:   test_eq(1e-1,0.1)   test_eq('\x20',32)   test_eq("\x20","\040") + test_any([[class G { mapping t=([]); +  class tO { void init(string name) { t[name]=this_object(); }} +  class W { inherit tO; void create() { init("foo"); }} + }; object x=G(); x->W(); return objectp(x->t->foo)]],1)   test_eq([[cpp("#define FOO(X,Y) (X) (Y)\nFOO( (A),(B) )")]],"# 1 \"-\"\n\n( (A) ) ( (B) )")   test_eq([[cpp("#define F 'F'\nF")]],"# 1 \"-\"\n\n'F'")   test_eq([[cpp("#define MAX(X,Y) ((X)>(Y)?(X):(Y))\n#define MAX3(X,Y,Z) MAX(MAX(X,Y),Z)\nMAX3(1,2,3)")]],"# 1 \"-\"\n\n\n(( (( 1 )>( 2 )?( 1 ):( 2 )) )>( 3 )?( (( 1 )>( 2 )?( 1 ):( 2 )) ):( 3 ))")
15:   // Testing the 'inline' keyword   test_program([[class foo { inline int c() { return time(); } int d() { return c(); } }; class bar { inherit foo; int c() { return 0; } } int a() { return bar()->d(); }]],0)    + test_compile([[class inherit_top { inherit top:top; constant top_the_class=top::the_class; class the_other_class { inherit top_the_class; } } ]]) + test_any([[ + class X { +  static string f() { return "p"; } +  static class gazonk { void create() { f(); }}; +  static class g { object e() { return gazonk(); }}; +  void create() { g()->e(); }}; return objectp(X()); ]],1) + test_any([[class A { protected int x=1; }; class B { inherit A; int foo() { return A::x; }}; return A()->x==B()->x && B()->foo()==A()->x;]],1) + test_any([[class C { int q() { return p(); } int p() { return 17; }}; return C()->q();]],17) + test_any([[class C1 { +  class D { string id() { return "foo"; } }; +  class Y { program YinD() { return D; }} }; +  class C2 { inherit C1; class D { string id() { return "bar"; } } }; +  return C2()->Y()->YinD()()->id()]],"bar")   test_any([[object o=class foo{int c;class bar{void create(){c++;};}}(); o->bar(); return o->c;]],1)   test_do([[add_constant("GURKA2",class foo { int c; class bar{void create() {c+=17;}}}()); ]])   test_any([[class x { inherit GURKA2.bar; }(); return GURKA2->c;]],17)
556:   test_true(!(""!=""))   test_true(""!="foo")    - test_cmp(1,2) - test_cmp(1.0,2.0) - test_cmp(1,2.0) - test_cmp(1.0,2) - test_cmp("a","b") - test_cmp("","b") + test_cmp3(1,2,3) + test_cmp3(1.0,2.0,3.0) + test_cmp3(1,2.0,3.6) + test_cmp3(1.0,2,4) + test_cmp3("a","b","c") + test_cmp3("","b","cc")      // hex construction   test_eq(0,0x0)
647:   test_eq(2.0*2*2.0*2*2.0,32.0)   test_eq(({"foo","bar","gazonk"})*"-","foo-bar-gazonk")   test_equal( ({ ({1}), ({2}), ({3}) })*({8}), ({1,8,2,8,3})) + test_equal( ({ 1 })*3, ({1,1,1}) ) + test_equal( "foo"*3, "foofoofoo" )      // testing /   test_eq(12/3,4)
675:   test_equal(({1,2,3,4})/({}),({ ({1}), ({2}), ({3}), ({4}) }))   test_equal(({1,0,1,2,1,2,2,2,1,1,1})/({2,1}),({ ({1,0,1}), ({2,2}), ({1,1}) }))   test_equal( ({1,2,3})/({2,3}), ({ ({1}), ({}) }) ) + test_eq([[`/(20,2,2)]],5) + test_eq([[`/(13,2,3)]],2) + test_equal("foobargazonk"/1,"foobargazonk"/"") + test_equal("foobargazonk"/2,({"fo","ob","ar","ga","zo","nk"})) + test_equal("foobargazonk"/3,({"foo","bar","gaz","onk"})) + test_equal("foobargazonk"/4,({"foob","arga","zonk"})) + test_equal("foobargazonk"/5,({"fooba","rgazo"})) + test_equal("foobargazonk"/-6,({"foobar","gazonk"})) + test_equal("foobargazonk"/-7,({"rgazonk"}))    -  + test_equal("foobargazonk"/5.0,({"fooba","rgazo","nk"})) + test_equal("foobargazonk"/-5.0,({"fo","obarg","azonk"})) + test_equal("foobargazonk"/2.5,({"fo","oba","rg","azo","nk"})) +  + test_equal(({1,2,3})/1,({ ({1}), ({2}), ({3}) })) + test_equal(({1,2,3})/2,({ ({1,2}) })) + test_equal(({1,2,3})/-2,({ ({2,3}) })) +  + test_equal(({1,2,3})/2.0,({ ({1,2}), ({3}) })) + test_equal(({1,2,3})/-2.0,({ ({1}), ({2,3}) })) + test_equal(({1,2,3})/1.5,({ ({1}), ({2,3}) })) +    // testing %   test_eq(12%3,0)   test_eq(13%3,1)
702:   test_eq(14.5 % 3,2.5)   test_eval_error(return 15.0 % 0.0)    + test_eq("foobargazonk"%5,"nk") + test_eq("foobargazonk"%-5,"fo") + test_equal(({1,2,3})%2,({3})) + test_equal(({1,2,3})%-2,({1})) +  +    // testing &&   test_eq(0 && 1,0)   test_eq(1 && 0,0)
842:   test_equal(({1,2,3})[1..0],({}))   test_equal(({1,2,3})[0..-100],({}))    + // casting + test_eq([[(int)1]],[[1]]) + test_eq([[(int)1.0]],[[1]]) + test_eq([[(int)"1"]],[[1]]) + test_eq([[(float)"1"]],[[1.0]]) + test_eq([[(float)"1.0"]],[[1.0]]) + test_eq([[(float)1.0]],[[1.0]]) + test_eq([[(float)1]],[[1.0]]) + test_eq([[(string)1]],[["1"]]) + test_equal([[(array)(["1":1])]],[[ ({ ({"1", 1}) }) ]]) + test_equal([[(array(int)) ({"1","4711",2.0,4})]],[[({1,4711,2,4})]]) +  +    // testing @   test_equal(({1,2,3}),lambda(mixed ... x) { return x; }(@a()))   test_equal("foo"/"",lambda(mixed ... x) { return x; }(@a()))