pike.git
/
src
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/testsuite.in:10888:
test_do([[ class A { mixed ``+(mixed x) { return sprintf("%O",x)-" "-"\n"; } }; add_constant("A",A); ]]) test_eq(`+(({1}),({2}),A()), "({/*2elements*/1,2})") test_eq(`+((<1>),(<2>),A()), "(</*2elements*/1,2>)") test_eq(`+(([1:2]),([3:4]),A()), "([/*2elements*/1:2,3:4])") test_do(add_constant("A"))
+
test_do([[
+
class A {
+
mixed `+(mixed x) { return UNDEFINED; }
+
mixed ``+(mixed x) { return UNDEFINED; }
+
};
+
add_constant("A",A);
+
]])
+
test_eval_error(`+(A(), ({1}), ({2})), ({1,2}))
+
test_eval_error(`+(({1}), A(), ({2})), ({1,2}))
+
test_do(add_constant("A"))
+
// - `- test_do([[ class A (int x) { mixed `-(mixed y) { return this_program(x - (objectp(y)?y->x:y)); } // Optimizer will modify the code which requires `+. mixed `+(int y) { return this_program(x+y); } }; add_constant("A",A); ]])