pike.git/
src/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2001-05-19
2001-05-19 08:30:02 by Mirar (Pontus Hagland) <pike@sort.mirar.org>
1f4dbd158a84f0b0d0af374573826de803396d1d (
46
lines) (+
44
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
added compile-crash test to testsuite
Rev: src/testsuite.in:1.413
1:
-
test_true([["$Id: testsuite.in,v 1.
412
2001/05/
17
23
:
49
:
07
hubbe
Exp $"]]);
+
test_true([["$Id: testsuite.in,v 1.
413
2001/05/
19
08
:
30
:
02
mirar
Exp $"]]);
cond([[all_constants()->_verify_internals]], [[
770:
test_do(_static_modules()) test_compile_any([[import Stdio; class x { string y() { read_file("foo"); } }]])
+
dnl ----------------------------------------------------------------
+
dnl scopes and stuff
+
dnl ----------------------------------------------------------------
+
dnl dnl Undocumented but important behaviour... dnl
805:
]])
+
test_any([[
+
Stdio.write_file("testsuite_test.pmod",
+
#"
+
// this crashes Pike /Mirar 2001-05-19
+
// I haven't been able to minimize it futher,
+
// and it needs to be in a separate module.
+
+
mapping es=0;
+
+
string efoo(string e)
+
{
+
if (!es)
+
{
+
mapping res=([]);
+
+
string l;
+
+
if (sscanf(l,\"%s%s\",string ext,string type)==4 &&
+
ext!=\"\" && ext[0]!=\"#\") // note the type error
+
res[ext]=type;
+
+
es=res;
+
}
+
}
+
");
+
+
// turn this on when the bug is found
+
// master()->set_inhibit_compile_errors(lambda(){});
+
+
catch {
+
compile_string("import \".\";\n"
+
"int foo() { testsuite_test.efoo; }\n");
+
};
+
return 0;
+
]],0);
+
test_compile_any([[int log() { return 17; } class Greta { int hanna() { return log(); } }]]) test_compile_any([[int kajsa(int a,int b) { return 17; } class Jenny { int kajsa() { return 17; } class Greta { int hanna() { return kajsa(); } } }]]) test_any([[add_constant("kajsa",lambda(int a,int b) { return 17; }); return compile_string("int kajsa() { return 17; } class Greta { int hanna() { return kajsa(); } }")()->kajsa()]],17)
1081:
return sizeof( Program.all_inherits(D) - ({A,B,C}) ); ]],0)
-
+
test_program([[ int errors;
1206:
]])
+
+
test_true([[Program.implements( class { int x; string y; void foo(int x) {} }, class { void foo(mixed z) {} int x; })]]) test_false([[Program.implements( class { int x; string y; void foo(int x) {} },