pike.git/
src/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2022-07-04
2022-07-04 13:45:02 by Henrik Grubbström (Grubba) <grubba@grubba.org>
f4d46fd204e99a7a0240c6b444ace4049e57fb16 (
33
lines) (+
23
/-
10
)
[
Show
|
Annotate
]
Branch:
master
Testsuite: Fix types for some lfuns.
Also fixes a syntax error.
866:
test_equal([[ typeof(sprintf("%4[1]c", 17)); ]], [[ typeof([string(8bit)](mixed)"") ]]); test_equal([[ typeof(sprintf("%[1]n", 17)); ]],
-
[[ typeof(
[string(zero)](mixed)
"") ]]);
+
[[ typeof("") ]]);
test_equal([[ typeof(aggregate("foo"));]], [[ typeof([array(string(3: 102..111))](mixed)({})) ]]);
11619:
test_eval_error(Gmp.mpz(1700000000000000000000)+class{protected mixed ``+(mixed n){return (<n>);}}()) test_do([[
-
class A (int x) { protected
mixed
`+(mixed y) { return this_program(x + (objectp(y)?y->x:y)); } };
+
class A (int x) {
+
protected
this_program
`+(mixed y) {
+
return this_program(x + (objectp(y)?y->x:y));
+
}
+
};
add_constant("A",A); ]]) test_eq(`+(A(3),A(2))->x, 5)
11632:
test_do(add_constant("A")); test_do([[
-
class A (int x) { protected
mixed
``+(mixed y) { return this_program(x + (objectp(y)?y->x:y)); } };
+
class A (int x) {
+
protected
this_program
``+(mixed y) {
+
return this_program(x + (objectp(y)?y->x:y));
+
}
+
};
add_constant("A",A); ]]) test_eq(`+(A(3),A(2))->x, 5)
11646:
test_do([[ class A {
-
protected
mixed
`+(
string
s) { return "`+"+s; }
-
protected
mixed
``+(
string
s) { return s+"``+"; }
-
protected
mixed
`+=(
string
s) { return "`+="+s; }
+
protected
string
`+(
mixed
s) { return "`+"+s; }
+
protected
string
``+(
mixed
s) { return s+"``+"; }
+
protected
string
`+=(
mixed
s) { return "`+="+s; }
}; add_constant("A",A); ]])
11728:
test_do(add_constant("A")); test_do([[
-
class A (int x) { protected
mixed
`-(mixed y) { return this_program(-x); } };
+
class A (int x) {
+
protected
this_program
`-(mixed
|void
y) {
+
return this_program(-x);
+
}
+
};
add_constant("A",A); ]]) test_eq(`-(A(5))->x, -5)