Branch: Tag:

2016-11-25

2016-11-25 10:26:35 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Testsuite [Compiler]: Fixed some more broken class tests.

Fixes typo in fix from 5aa1376f27fc1b09462d3629f727f28d9bd1e095,
as well as several tests that were missed in that commit.

3303:   test_compile_error([[object x = Gmp.mpz(17); constant y = x;]])   test_any([[object(Stdio.File) f; f=Stdio.File(); return 1]],1)   test_compile([[float t=gauge { string foo; foo; };]]) - test_compile_any([[class { object(Stdio.FILE) f; void create() { f=Stdio.FILE(); }}]]) + test_compile_any([[class Foo { object(Stdio.FILE) f; void create() { f=Stdio.FILE(); }}]])   test_eq([[compile_string("#define A(X) (X)\nint x() { return A \n\t(1); }")()->x()]],1)      test_any([[class G { mapping t=([]);
4485:    class C2 { inherit C1; class D { string id() { return "bar"; } } };    return C2()->Y()->YinD()()->id()]],"bar")   test_any([[object o=class {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) - test_any([[class x { inherit GURKA2.bar; }(); return GURKA2->c;]],34) + test_do([[add_constant("GURKA2",class { int c; class bar{void create() {c+=17;}}}()); ]]) + test_any([[class { inherit GURKA2.bar; }(); return GURKA2->c;]],17) + test_any([[class { inherit GURKA2.bar; }(); return GURKA2->c;]],34)    - test_do([[add_constant("GURKA2",class foo { int c; class bar{void create() { class sune { void create() {c+=17;}}(); }}}()); ]]) + test_do([[add_constant("GURKA2",class { int c; class bar{void create() { class { void create() {c+=17;}}(); }}}()); ]])   test_any([[class { inherit GURKA2.bar; }(); return GURKA2->c;]],17)   test_any([[class { inherit GURKA2.bar; }(); return GURKA2->c;]],34)   test_do([[add_constant("GURKA2");]]);
8004:         // class - test_true(programp(class c {})) - test_true(functionp(class c { int foo() { return 1; }}()->foo)) - test_true(class c { int foo() { return 1; }}()->foo()) - test_true(class c { int i=1; }()->i) - test_false(class c { int foo() { return 1; }}()->bar) - test_eq(class c { program foo=class c { int i=20; }; }()->foo()->i,20) + test_true(programp(class {})) + test_true(functionp(class { int foo() { return 1; }}()->foo)) + test_true(class { int foo() { return 1; }}()->foo()) + test_true(class { int i=1; }()->i) + test_false(class { int foo() { return 1; }}()->bar) + test_eq(class { program foo=class c { int i=20; }; }()->foo()->i,20)      // class()   test_true(programp(class (){}))