pike.git/
src/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2001-12-15
2001-12-15 01:53:10 by Martin Stjernholm <mast@lysator.liu.se>
06203b5febaa624ebdaef40e7e736ebb39c0c3fe (
57
lines) (+
56
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
Some tests for inherit in combination with delayed compilation.
Rev: src/testsuite.in:1.476
1:
-
test_true([["$Id: testsuite.in,v 1.
475
2001/12/
12
21
:
14
:
04
mast Exp $"]]);
+
test_true([["$Id: testsuite.in,v 1.
476
2001/12/
15
01
:
53
:
10
mast Exp $"]]);
cond([[all_constants()->_verify_internals]], [[
1122:
Stdio.recursive_rm("testsuite_test_dir.pmod"); ]]);
+
test_do([[
+
Stdio.recursive_rm ("testsuite_test_dir.pmod");
+
mkdir ("testsuite_test_dir.pmod");
+
+
Stdio.write_file ("testsuite_test_dir.pmod/module.pmod", #"\
+
.B b();
+
class X {}");
+
Stdio.write_file ("testsuite_test_dir.pmod/A.pike", #"\
+
int f() {return 0;}");
+
Stdio.write_file ("testsuite_test_dir.pmod/B.pike", #"\
+
inherit .A;
+
.X g() {return f() && .X();}");
+
+
object orig_master = master();
+
replace_master (object_program (orig_master)());
+
mixed err = catch {
+
compile_string ("import \".\";\n"
+
"int foo() { testsuite_test_dir.B(); }",
+
"test");
+
};
+
replace_master (orig_master);
+
if (err) throw (err);
+
+
Stdio.recursive_rm ("testsuite_test_dir.pmod");
+
]]);
+
+
test_do([[
+
Stdio.recursive_rm ("testsuite_test_dir.pmod");
+
mkdir ("testsuite_test_dir.pmod");
+
+
Stdio.write_file ("testsuite_test_dir.pmod/module.pmod", #"\
+
.B b();
+
class X {}");
+
Stdio.write_file ("testsuite_test_dir.pmod/A.pike", #"\
+
int f() {return 0;}");
+
Stdio.write_file ("testsuite_test_dir.pmod/B.pmod", #"\
+
class B {
+
inherit .A;
+
.X g() {return f() && .X();}
+
}");
+
+
object orig_master = master();
+
replace_master (object_program (orig_master)());
+
mixed err = catch {
+
compile_string ("import \".\";\n"
+
"int foo() { testsuite_test_dir.B.B(); }",
+
"test");
+
};
+
replace_master (orig_master);
+
if (err) throw (err);
+
+
Stdio.recursive_rm ("testsuite_test_dir.pmod");
+
]]);
+
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)