pike.git/
src/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2001-01-17
2001-01-17 17:38:47 by Martin Stjernholm <mast@lysator.liu.se>
81316409152f6f1cf26e3bad36ef3dd591766fd5 (
44
lines) (+
43
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
Ported gc test from 7.0, for completeness sake.
Rev: src/testsuite.in:1.372
1:
-
test_true([["$Id: testsuite.in,v 1.
371
2001/01/
16
09
:
36
:
31
hubbe
Exp $"]]);
+
test_true([["$Id: testsuite.in,v 1.
372
2001/01/
17
17
:
38
:
47
mast
Exp $"]]);
cond([[all_constants()->_verify_internals]], [[
251:
]])
+
test_any([[
+
object f = class {
+
array recursive(mixed func, array data, mixed ... args)
+
{
+
array ret=({});
+
+
foreach(data, mixed foo)
+
{
+
if(arrayp(foo))
+
{
+
ret+=({ recursive(func, foo, @args) });
+
}else{
+
ret+=({ foo });
+
}
+
}
+
+
return func(ret, @args);
+
};
+
}();
+
+
mixed x = ({ "A", ({}) });
+
x = f->recursive(replace, x, "B", ({}));
+
+
for(int i = 0; i < sizeof(x); i++) {
+
if (!stringp(x[i]) && !arrayp(x[i])) return 0;
+
}
+
return 1;
+
]], 1);
+
test_false([[object_variablep(class X { int y; int z() { return 1; }}(),"foo")]]) test_false([[object_variablep(class X { int y; int z() { return 1; }}(),"z")]]) test_true([[object_variablep(class X { int y; int z() { return 1; }}(),"y")]])
1963:
return !sizeof (m); ]])
+
test_do([[
+
class Foo
+
{
+
object foo;
+
static void create(object o) {foo = o;}
+
};
+
Foo foo;
+
for(int i=0; i < 1000000; i++)
+
foo = Foo(foo);
+
gc();
+
]])
+
test_any([[ mapping m=([]); m->self=m;