pike.git
/
src
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/testsuite.in:794:
return ([1: "foo"])[i] || "bar"; // No warning here. C.f. lyslys 16630665. } }; class B { inherit A; constant i = 1; }; return B()->f(); ]], "foo")
-
ignore_warning("Wrong return type.", [[
-
ignore_warning("Expected: string.", [[
-
ignore_warning("Got : array(string).", [[
-
test_program_equal([[
-
#pike 7.6
-
string a()
-
{
-
string|array(string) res = ({"spud"});
-
return res + ({});
-
}
-
]], ({"spud"}))
-
]])]])]])
-
+
// Warnings test_compile_warning([[ int *a ]]) test_compile_warning([[ int|float *a ]]) test_compile_warning([[ [mixed]1 ]]) test_compile_warning([[ class A { int a = 6; }; class B { constant a = 5; inherit A;
pike.git/src/testsuite.in:2231:
]]) test_compile_error_any([[ class A {} class B { inherit A:C; mixed f() {return A::this_program;} } ]])
-
test_compile_error_any([[
-
#pike 7.6
-
class A {}
-
class B {
-
inherit A:C;
-
mixed f() {return C::this_program;}
-
}
-
]])
-
+
test_any([[ class A {}; class B { inherit A:C; mixed f() {return C::this_program;} }; return B()->f() == A; ]], 1) test_any([[
pike.git/src/testsuite.in:5375:
// m_delete test_any_equal([[ mapping m=([1:1]); m_delete(m,0); return m; ]],[[ ([1:1]) ]]) test_any_equal([[ mapping m=([1:1,0:3]); m_delete(m,0); return m; ]],[[ ([1:1]) ]]) test_any([[mapping a=([1:1]); return m_delete(a,1)]],1) test_any([[mapping m=([]); m[1]++; return m[1];]],1) test_any([[mapping m=([1:1]); m[1]++; return m[1];]],2) test_any([[mapping m=([1:1]); m[1]++; return m[1]++;]],2) test_any([[mapping m=([]); m[1]++; m[1]++; return m[1];]],2)
-
ignore_warning("Bad argument 2 to m_delete.", [[
-
ignore_warning("Expected: string.", [[
-
ignore_warning("Got : int(17..17).", [[
-
test_any([[
-
#pike 7.6
-
mapping(string:int) x = ([]);
-
return zero_type (m_delete (x, 17));
-
]], 1)
-
]])]])]])
-
+
// multiset tests test_any([[multiset m=(<>);int e; for(e=0;e<1000;e++) m[e]=1; for(e=0;e<1000;e++) if(!m[e]) return e; return -1; ]],-1) test_any([[multiset m=(<>);int e; for(e=0;e<1000;e++) m[e]++;
pike.git/src/testsuite.in:7924:
} return sum; } }; return Bar()->foo() ]], "foobarbaz") test_equal( array_sscanf("^^;|", "%[^-|]%s"), ({ "^^", ";|" }) ) test_any([[mixed a; sscanf("^^;|","%[^-|]",a); return a]],"^^")
-
ignore_warning("Bad argument 3 to sscanf_76.", [[
-
ignore_warning("Expected: string.", [[
-
ignore_warning("Got : int.", [[
-
test_any([[
-
#pike 7.6
-
int foo;
-
sscanf ("11", "%s", foo);
-
return foo;
-
]], "11")
-
]])]])]])
-
-
ignore_warning("Too many arguments to sscanf_76 (expected 2 arguments).", [[
-
ignore_warning("Got : string.", [[
-
test_any([[
-
#pike 7.6
-
string s;
-
sscanf ("foo", "%*s", s);
-
return s;
-
]], 0)
-
]])]])
-
+
// sscanf %O ------------------------------------------------------------- define(test_percent_o_raw, [[ test_equal(array_sscanf(]]$3[[,]]$1[[),[[$2]]) ]]) define(test_percent_o_fmt, [[ test_percent_o_raw(]]$1[[,]]$2[[,sprintf(]]$1[[,@]]$2[[)) ]]) define(test_percent_o_char, [[ dnl patsubst doesn't exist on all m4's (it's a gnuism?)
pike.git/src/testsuite.in:11594:
test_any_equal([[ mapping m = (["foo": "bar", "bar": "gnu", "gnu": "bar"]); array a = ({}); a += ({search (m, "bar")}); a += ({search (m, "bar", a[-1])}); a += ({search (m, "bar", a[-1])}); return sort (a); ]], sort(({0, "foo", "gnu"})))
-
// Some versions of Pike prior to 7.8 had unsigned characters.
-
// We regard this as an implementation bug, and thus no compat.
-
cond([[0]], [[
+
test_equal([[
-
#pike 7.6
+
sort(({"\Uffffffff","\0", "", "\177", "\377", "\U7fffffff"}));
-
]], ({ "", "\0", "\177", "\377", "\U7fffffff", "\Uffffffff" }))
-
]])
-
-
test_equal([[
-
sort(({"\Uffffffff","\0", "", "\177", "\377", "\U7fffffff"}));
+
]], ({ "", "\Uffffffff", "\0", "\177", "\377", "\U7fffffff" })) // test large searches (find string, size, pattern) define(test_search,[[ test_eq(sprintf($1+"%'"+$3+"'*n",$2)[..strlen($1)-1],$1) test_eq(search(sprintf($1+"%'"+$3+"'*n",$2),$1),0) test_eq(search(sprintf("%'"+$3+"'*n" ,$2),$1),-1) test_eq(search(sprintf("%'"+$3+"'*n"+$1,$2),$1),$2) test_eq(search(sprintf("%'"+$3+"'*n"+$1+"%'"+$3+"'*n",$2,$2),$1),$2) ]])
pike.git/src/testsuite.in:12893:
test_equal(indices(class {class A {int f(){}} class B {public inherit A;} class C {inherit B;}}()->C()), ({"f"})) test_equal(indices(class {class A {int f(){}} class B {protected inherit A;} class C {inherit B;}}()->C()), ({})) test_equal(indices(class {class A {int f(){}} class B {private inherit A;} class C {inherit B;}}()->C()), ({})) test_equal(indices(class {class A {int f(){}} class B {final inherit A;} class C {inherit B;}}()->C()), ({"f"})) test_equal( #pragma no_deprecation_warnings indices(class {class A {int f(){}} class B {nomask inherit A;} class C {inherit B;}}()->C()), ({"f"})) test_equal(indices(class {class A {int f(){}} class B {local inherit A;} class C {inherit B;}}()->C()), ({"f"})) test_equal(indices(class {class A {int f(){}} class B {inline inherit A;} class C {inherit B;}}()->C()), ({"f"}))
-
test_any([[
-
#pike 7.6
-
class Y {
-
protected object x = class X {}();
-
};
-
return has_index (Y(), "X");
-
]], 1)
-
+
// - modifiers, binding and redefinition properties with compile time access test_any(class A {int v=1;}; class B {inherit A; int v=2; int t(){return v;}}; return B()->t(), 2) test_any(class A {public int v=1;}; class B {inherit A; int v=2; int t(){return v;}}; return B()->t(), 2) test_any(class A {protected int v=1;}; class B {inherit A; int v=2; int t(){return v;}}; return B()->t(), 2) test_any(class A {private int v=1;}; class B {inherit A; int v=2; int t(){return v;}}; return B()->t(), 2) test_compile_error_any(class A {final int v=1;}; class B {inherit A; int v=2;};) test_compile_error_any( #pragma no_deprecation_warnings class A {nomask int v=1;}; class B {inherit A; int v=2;};)