pike.git/
src/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2001-10-06
2001-10-06 09:14:33 by Mirar (Pontus Hagland) <pike@sort.mirar.org>
34db63d1bc38be9c0c38d9674997e120045b93b0 (
52
lines) (+
50
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
test for infokom:350113 and bugfix in backtrace test
Rev: src/testsuite.in:1.460
1:
-
test_true([["$Id: testsuite.in,v 1.
459
2001/10/
05
09:
29
:
59
mirar Exp $"]]);
+
test_true([["$Id: testsuite.in,v 1.
460
2001/10/
06
09:
14
:
33
mirar Exp $"]]);
cond([[all_constants()->_verify_internals]], [[
930:
" return 17;\n" "}","test"); mixed err=catch { p()->foo(); };
+
if (err[1][-1][1]!=3)
+
{
+
werror("backtrace is:\n"+master()->describe_backtrace(err));
+
}
+
return err[1][-1][1];
+
]],3);
+
+
define(test_backtrace_line_charset, [[
+
test_any([[
+
program p=compile_string(
+
Locale.Charset.encoder("]]$1[[")->feed(
+
"#charset ]]$1[[\n"
+
"int foo()\n"
+
"{\n"
+
" error(\"test error\\n\"); // line 3\n"
+
" return 17;\n"
+
"}")->drain(),"test");
+
mixed err=catch { p()->foo(); };
if (err[1][0][1]!=3) { werror("backtrace is:\n"+master()->describe_backtrace(err)); } return err[1][0][1]; ]],3);
-
+
]])
+
dnl test_backtrace_line_charset(utf-7)
-
+
dnl ---------------------------------------------------------------- dnl scopes and stuff dnl ----------------------------------------------------------------
1026:
return 0; ]],0);
+
test_any([[
+
// infokom:350113
+
rm("testsuite_test.pmod");
+
mkdir("testsuite_test.pmod");
+
Stdio.write_file("testsuite_test.pmod/module.pmod",
+
#"
+
.A a() {return 0;}
+
");
+
Stdio.write_file("testsuite_test.pmod/A.pike",
+
#"
+
void create (.X x) {.y();}
+
");
+
+
// Compilation handler that hides compilation errors.
+
class handler
+
{ void compile_error(string file, int line, string err) { } };
+
+
catch {
+
compile_string(".testsuite_test.a","test",handler());
+
};
+
+
rm("testsuite_test.pmod/module.pmod");
+
rm("testsuite_test.pmod/A.pike");
+
rm("testsuite_test.pmod");
+
+
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)