pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:5149:    class Codec    {    mixed fooof (string name) {return all_constants()[name];}    function objectof = fooof;    function functionof = fooof;    function programof = fooof;       string nameof (mixed what)    {    if (string name = search (all_constants(), what)) return name; -  return ([])[0]; +  return UNDEFINED;    }       mixed encode_object (object o) {}    void decode_object (object o, mixed d) {}    }       mixed main()    {    array c = ({"subres"});    object o = compile (
pike.git/src/testsuite.in:5186:   ]],"foo")      test_any([[   // bug 3014   class Test   {    class Codec    {    mixed nameof (mixed what)    { -  return ([])[0]; +  return UNDEFINED;    }    mixed encode_object (object o) {}    void decode_object (object o, mixed d) {}    }       int main()    {    object o = compile_string (#"    constant x = ({0});    int f() {return 17;}
pike.git/src/testsuite.in:14071:   test_eq(zero_type(([7: 0])[7]),0)   test_eq(zero_type(([7: UNDEFINED])[7]),0)   test_eq(zero_type(UNDEFINED), 1)   test_eq(zero_type (m_delete (([]), 1)), 1)      test_eq(zero_type (allocate (5, UNDEFINED)[2]), 1);   test_eq(zero_type (allocate (5, 0)[2]), 0);   test_eq(zero_type (allocate (5)[2]), 0);      test_true([[lambda (int|void a) { return zero_type(a); }()]]) - test_true([[lambda () {mixed a; return zero_type(a = ([])[0]);}()]]) - test_true([[lambda () {mapping a=([]); return zero_type(a[0] = ([])[0]);}()]]) - test_true([[zero_type (lambda () {return ([])[0];}())]]) + test_true([[lambda () {mixed a; return zero_type(a = UNDEFINED);}()]]) + test_true([[lambda () {mapping a=([]); return zero_type(a[0] = UNDEFINED);}()]]) + test_true([[zero_type (lambda () {return UNDEFINED;}())]])      test_any([[    class A {    int j = 0;    int k = UNDEFINED;    int l;    };    A a = A();    return "" + zero_type(a->j) + zero_type(a->k) + zero_type(a->l) + zero_type(a->m) + " " + has_index(a, "j") + has_index(a, "k") + has_index(a, "l") + has_index(a, "m");   ]], "0101 1110")