pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:908:    return sprintf("%O", typeof(f[""])); ]],    "int")      test_any([[mapping(object:string)|mapping(string:int) f;    return sort((sprintf("%O", typeof(f[0])) - " ")/"|")*"|"; ]],    "int|string")      test_any([[class Foo { protected string `[](mixed y) {return "";} };    object(Foo) foo;    return sprintf("%O", typeof(foo[0])); ]], -  "zero | string") +  "string")      test_any([[class Foo { protected array(int) _indices() {return ({0});} };    object(Foo) foo;    return sprintf("%O", typeof(indices(foo))); ]], -  "zero | array(int)") +  "array(int)")      test_any([[class Foo { protected array(string) _values() {return ({""});} };    object(Foo) foo;    return sprintf("%O", typeof(values(foo))); ]], -  "zero | array(string)") +  "array(string)")      test_any([[mapping(string:int) foo;    array(string) bar;    return sprintf("%O", typeof(rows(foo, bar))); ]],    "array(int)")      // basic auto tests.   test_any([[    class Toplevel {    class Foo {
pike.git/src/testsuite.in:7281:    }();    f = 0;    gc();    }]]);       test_tests([[inherit "]]SRCDIR[[/test_gc.pike";]])       test_any([[mapping q=([ "t":class {} ()]); gc(); if(!objectp(q->t)) return -1; set_weak_flag(q,1); gc(); if(objectp(q->t)) return -2; return 0;]],0);       test_do([[class bar { object foo; protected void create(void|object tmp) { foo=tmp; } }; -  object o=bar(),o2=o; +  object|zero o=bar(),o2=o;    for(int e=0;e<10000;e++) o=bar(o);    o2->foo=o;    o=o2=0;    gc();    ]])       test_any([[    object o = class{}();    mapping m = set_weak_flag (([o: "x"]), Pike.WEAK_INDICES);    gc();
pike.git/src/testsuite.in:8476:    C (1,1);   ]])      // type checks   test_compile_error([[} int foo() { return]]);   test_compile_error([[} void foo() { return 1]]);   test_compile([[mapping|zero a; int b; a = b = 0;]]);   test_compile_error([[mapping|zero a; int b; a = b = 1;]]);   test_compile_any([[void a(int q){} void b(function(int:void) f){} void c(){b(a);}]]);   test_compile_error_any([[void a(int i){} void b(function(:void) f){} void c(){b(a);}]]); - test_compile_any([[void a(){} function(int:void) b = a;]]); + test_compile_any([[void a(int i){} function(int:void) b = a;]]);   test_compile_error_any([[void a(int i){} function(:void) b = a;]]);      // Duplicate local variable   test_compile_error([[void f() {int i; int i;}]]);   test_compile_error([[void f() {int i; mapping i;}]]);   test_compile_error([[void f() {int i; void i() {};}]]);   test_compile_error([[void f (int i) {string i;}]]);      // Not yet cataloged   test_any(int i=10; { int i=0; } return i, 10)
pike.git/src/testsuite.in:12223:   // - endgrent   // - endpwent      // - enumerate   // Tested in lib      // - equal   // equal is already tested a lot in this script      test_any([[ -  class X (string s) {}; +  class X (string|zero s) {};    return equal (({X ("foo")}), ({X (0)}));   ]], 0)   test_any([[ -  class X (string s) {}; +  class X (string|zero s) {};    return equal (({X (0)}), ({X ("foo")}));   ]], 0)   test_any([[    class X (string s) {};    return equal (({X ("foo")}), ({X ("foo")}));   ]], 1)      // - errno      // - error
pike.git/src/testsuite.in:14258:   test_program(inherit test2; inherit test; mixed a() { setw(20); setb(22); return w==20 && b==22; })      test_do(add_constant("test"))   test_do(add_constant("test2"))      test_eval_error(return class {int i;void foo(){ destruct(this_object());i=0;return i;}}()->foo())   test_compile_error(return class c{int i;void foo(){ destruct(this_object());i=0;return i;}}()->foo())   test_eq(a,this_object()->a)      // - catch - test_false([[class { string test(string foo) { catch { return lower_case(foo); }; return foo; }}()->test(0); ]]) + test_false([[class { string test(string|zero foo) { catch { return lower_case(foo); }; return foo; }}()->test(0); ]])   test_true([[catch (1.0 / 0.0)]])   test_true([[catch {float f = 1.0 / 0.0;}]])         // Pike modules      // - this failed in Calendar.Timezone      test_compile(   [[
pike.git/src/testsuite.in:15329:    object null = Val.null;    };    object a = A();    return map(values(a), objectp);   ]], ({ 1, 1, 1 }))      dnl This syntax error generates a Fatal with PIKE_DEBUG   test_compile_error(object(foo bar) o;)      test_do([[ -  class A(object ctx) { +  class A(object|zero ctx) {    this_program get(void|int level) {    this_program ret = this;       for (int i = 0; i < level; i++) ret = (ret && ret->ctx);       return ret || this;    }    };       return A(0)->get(UNDEFINED);