pike.git
/
src
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/testsuite.in:1:
-
test_true([["$Id: testsuite.in,v 1.
584
2003/01/
13
04
:
36
:
59
nilsson Exp $"]]);
+
test_true([["$Id: testsuite.in,v 1.
585
2003/01/
15
14
:
49
:
52
nilsson Exp $"]]);
// This triggered a bug only if run sufficiently early. test_compile_any([[#pike 7.2]]) cond([[all_constants()->_verify_internals]], [[ test_do(_verify_internals()) ]]); test_eq(1e1,10.0); test_eq(1E1,10.0);
pike.git/src/testsuite.in:6194:
test_eq(1.0+1,2.0) test_eq(1+1.0,2.0) test_eq(1+(-1.0),0.0) test_eq(1.0+(-1),0.0) test_eq((-1)+(-1.0),-2.0) test_eq((-1.0)+(-1),-2.0) test_equal(({1,2,3})+({4,5,6}),({1,2,3,4,5,6})) test_equal((<1,2,3,4>)+(<4,5,6>),(<1,2,3,4,4,5,6>)) test_equal(([0:1,3:6])+([5:2,3:6]),([0:1,3:6,3:6,5:2])) test_eval_error(return this_object() + this_object())
+
test_any(return((1+2+3)-(1+2-3)), 6)
-
+
// testing - test_eq(10-3,7) test_eq(3-10,-7) test_eq(10.0-3.0,7.0) test_eq(3.0-10.0,-7.0) test_eq(10-3.0,7.0) test_eq(3-10.0,-7.0) test_eq(10.0-3,7.0) test_eq(3.0-10,-7.0) test_eq(034567 - 10000,4711)
pike.git/src/testsuite.in:6231:
test_eq(3.0*4.0,12.0) test_eq(4.0*3.0,12.0) test_eq(2.0*2.0*2.0*2.0*2.0,32.0) test_eq(3*4.0,12.0) test_eq(4*3.0,12.0) test_eq(2*2.0*2.0*2.0*2.0,32.0) test_eq(3.0*4,12.0) test_eq(4.0*3,12.0) test_eq(2.0*2*2.0*2*2.0,32.0)
+
test_eq([[({})*""]],"")
+
test_eq([[({"foo",0,"bar"})*"-"]],"foo-bar")
+
test_eq([[({1.0,"foo",0,"bar",this_object(),([])})*"-"]],"foo-bar")
+
test_eq([[({"f","o","o"})*""]],"foo")
+
test_eq(({"foo","bar","gazonk"})*"-","foo-bar-gazonk") test_eq(({"f\777\777","bar","gaz\777nk"})*"-","f\777\777-bar-gaz\777nk") test_eq(({"f\7777777\7777777","bar","gaz\7777777nk"})*"-","f\7777777\7777777-bar-gaz\7777777nk") test_eq(({"foo","bar","gazonk"})*"\777","foo\777bar\777gazonk") test_eq(({"f\777\777","bar","gaz\777nk"})*"\777","f\777\777\777bar\777gaz\777nk") test_eq(({"f\7777777\7777777","bar","gaz\7777777nk"})*"\777","f\7777777\7777777\777bar\777gaz\7777777nk") test_eq(({"foo","bar","gazonk"})*"\7777777","foo\7777777bar\7777777gazonk") test_eq(({"f\777\777","bar","gaz\777nk"})*"\7777777","f\777\777\7777777bar\7777777gaz\777nk")
pike.git/src/testsuite.in:6312:
test_equal("f\777\777bargaz\777nk"/3,({"f\777\777","bar","gaz","\777nk"})) test_equal("f\777\777bargaz\777nk"/4,({"f\777\777b","arga","z\777nk"})) test_equal("f\777\777bargaz\777nk"/5,({"f\777\777ba","rgaz\777"})) test_equal("f\777\777bargaz\777nk"/-6,({"f\777\777bar","gaz\777nk"})) test_equal("f\777\777bargaz\777nk"/-7,({"rgaz\777nk"})) test_equal("f\777\777bargaz\777nk"/5.0,({"f\777\777ba","rgaz\777","nk"})) test_equal("f\777\777bargaz\777nk"/-5.0,({"f\777","\777barg","az\777nk"})) test_equal("f\777\777bargaz\777nk"/2.5,({"f\777\777","ba","rga","z\777","nk"}))
+
test_equal(""/"hej", ({""}))
+
test_equal("hej"/"hej", ({"",""}))
test_equal("f\7777777\7777777bargaz\7777777nk"/1,"f\7777777\7777777bargaz\7777777nk"/"") test_equal("f\7777777\7777777bargaz\7777777nk"/2,({"f\7777777","\7777777b","ar","ga","z\7777777","nk"})) test_equal("f\7777777\7777777bargaz\7777777nk"/3,({"f\7777777\7777777","bar","gaz","\7777777nk"})) test_equal("f\7777777\7777777bargaz\7777777nk"/4,({"f\7777777\7777777b","arga","z\7777777nk"})) test_equal("f\7777777\7777777bargaz\7777777nk"/5,({"f\7777777\7777777ba","rgaz\7777777"})) test_equal("f\7777777\7777777bargaz\7777777nk"/-6,({"f\7777777\7777777bar","gaz\7777777nk"})) test_equal("f\7777777\7777777bargaz\7777777nk"/-7,({"rgaz\7777777nk"})) test_equal("f\7777777\7777777bargaz\7777777nk"/5.0,({"f\7777777\7777777ba","rgaz\7777777","nk"})) test_equal("f\7777777\7777777bargaz\7777777nk"/-5.0,({"f\7777777","\7777777barg","az\7777777nk"}))
pike.git/src/testsuite.in:7756:
define(do_test_foop,[[ test_eq($1 (17), !($2)) test_eq($1 (1.7), !($2-1)) test_eq($1 ("17"), !($2-2)) test_eq($1 (this_object()), !($2-3)) test_eq($1 (a), !($2-4)) // a is the test function test_eq($1 (({})), !($2-5)) test_eq($1 (([])), !($2-6)) test_eq($1 ((<>)), !($2-7)) test_eq($1 (object_program(this_object())), !($2-8))
+
test_eq($1 (typeof(1)), 0)
]]) do_test_foop(intp,0) do_test_foop(floatp,1) do_test_foop(stringp,2) do_test_foop(objectp,3) do_test_foop(functionp,4) do_test_foop(arrayp,5) do_test_foop(mappingp,6) do_test_foop(multisetp,7)
pike.git/src/testsuite.in:7787:
test_eq(foobar(),1) test_do(add_constant("foobar")) test_any([[ #if efun(foobar) return 1; #else return 0; #endif ]],0)
+
+
// #### Test everything in all_constants.
+
+
// - __automap__
+
// - __empty_program
+
// - __null_program
+
// - __parse_pike_type
+
// - __placeholder_object
+
// - _describe_program
+
// - _disable_threads
+
// - _do_call_outs
+
// - _exit
+
// - _gc_status
+
// - _leak
+
// - _memory_usage
+
// - _next
+
// - _prev
+
// - _refs
+
// - _static_modules
+
// - _typeof
+
+
// - _verify_internals
+
cond([[all_constants()->_verify_internals]],
+
[[
+
test_do(_verify_internals())
+
]])
+
+
// - `!
+
// - `!=
+
// - `%
+
// - `&
+
// - `()
+
// - `*
+
+
// - `+
+
test_eq(`+(1,1),2)
+
test_eq(`+(1,-2),-1)
+
test_eq(`+(-2,-2),-4)
+
test_eq(`+("hi","there"),"hithere")
+
+
test_eq(`+("hi\777","there"),"hi\777there")
+
test_eq(`+("hi","there\777"),"hithere\777")
+
+
test_eq(`+("hi\7777777","there"),"hi\7777777there")
+
test_eq(`+("hi","there\7777777"),"hithere\7777777")
+
+
test_eq(`+("human","number",666),"humannumber666")
+
test_eq(`+("human","number",666),"humannumber666")
+
test_eq(`+("human","number",666),"humannumber666")
+
test_eq(`+("human","number",666,111),"humannumber666111")
+
test_eq(`+("humannumber",`+(666+111)),"humannumber777")
+
test_eq(`+("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y"),"abcdefghijklmnopqrstuvxy")
+
test_eq(`+(1.0+1.0),2.0)
+
test_eq(`+(1.0,-1.0),0.0)
+
test_eq(`+(-1.0,-1.0),-2.0)
+
test_equal(`+(({1,2,3}),({4,5,6})),({1,2,3,4,5,6}))
+
test_equal(`+((<1,2,3,4>),(<4,5,6>)),(<1,2,3,4,4,5,6>))
+
test_equal(`+(([0:1,3:6]),([5:2,3:6])),([0:1,3:6,3:6,5:2]))
+
+
// - `-
+
// - `->
+
// - `->=
+
// - `/
+
// - `<
+
// - `<<
+
// - `<=
+
// - `==
+
// - `>
+
// - `>=
+
// - `>>
+
// - `[]
+
// - `[]=
+
// - `^
+
// - `|
+
// - `~
+
+
// - abs
+
// - acos
+
// Tested in _math
+
+
// - add_constant
+
+
// - add_include_path
+
// - add_module_path
+
// - add_program_path
+
// Tested in lib
+
// - aggregate
-
test_
true
(
arrayp(
aggregate()
))
-
test_eq
(
sizeof(aggregate(
))
,0)
+
test_
equal
(aggregate()
,
(
{}
))
test_equal(aggregate(1,2,3,4),({1,2,3,4})) // - aggregate_multiset
-
test_
true
(
multisetp
(aggregate_multiset()))
+
test_
equal
(
aggregate_multiset
(
), (<>))
+
test_equal(
aggregate_multiset(
1,1
)
, (<1,1>
))
+
test_equal(aggregate_multiset(1,2,"3"), (<1,2,"3">))
// - aggregate_mapping
-
test_
true
(
multisetp
(aggregate_
multiset
()))
+
test_
equal
(
aggregate_mapping
(
), ([]))
+
test_equal(
aggregate_
mapping
(
1,2,3,4
)
, ([1:2,3:4]
))
+
test_eval_error(aggregate_mapping(1,2,3))
-
+
// - alarm
+
// - all_constants test_true(mappingp(all_constants()))
-
test_true(all_constants()["all_constants"])
+
test_eq(all_constants()["all_constants"],all_constants)
-
+
// - all_threads
+
// - allocate
-
test_
true
(
arrayp(
allocate(0)))
+
test_
equal
(allocate(0)
,({}
))
test_equal(allocate(2),({0,0})) test_false(allocate(2)==({0,0}))
-
+
test_equal(allocate(2,2),({2,2}))
test_true(allocate(65536,random))
-
+
// - array_sscanf
+
+
// - arrayp
+
// Tested in foop
+
+
// - asin
+
// - atan
+
// - atan2
+
// Tested in _math
+
+
// - atexit
+
// - backtrace test_true(arrayp(backtrace())) test_eq(backtrace()[-1][2],a)
-
+
// - basename
+
// Tested in lib
+
+
// - basetype
+
// - call_function test_eq(1,call_function(a)) test_eq(1,call_function(lambda(int a){ return a; },1)) test_eq(1,call_function(intp,1))
-
+
// - call_out
+
// - call_out_info
+
// - callablep
+
// - cd
+
+
// - ceil
+
// Tested in _math
+
+
// - chmod
+
// - chown
+
// - chroot
+
// - cleargroups
+
// - new/clone test_true([[ #pike 7.2 objectp(new(compile_string("int foo() { return 17; }"))) ]]) test_eq([[ #pike 7.2 new(compile_string("int foo() { return 17; }"))->foo() ]],17) test_true([[ #pike 7.2 objectp(clone(compile_string("int foo() { return 17; }"))) ]]) test_eq([[ #pike 7.2 clone(compile_string("int foo() { return 17; }"))->foo() ]],17)
-
+
// - closelog
+
// - column
+
// - combine_path test_eq([[combine_path("/foo/bar/gazonk/","..")]],"/foo/bar") test_eq([[combine_path("/foo/bar/gazonk","..")]],"/foo/bar") test_eq([[combine_path("/foo/bar/", "gazonk")]],"/foo/bar/gazonk") test_eq([[combine_path("/foo/bar", "gazonk")]],"/foo/bar/gazonk") test_eq([[combine_path("/.../","sune")]],"/.../sune") test_eq([[combine_path("/",".")]],"/") test_eq([[combine_path("/","foo/.../sune")]],"/foo/.../sune") test_eq([[combine_path("/./foo/bar//gazonk/","../")]],"/foo/bar/") test_eq([[combine_path("/","/foo/./bar/gazonk/..")]],"/foo/bar")
pike.git/src/testsuite.in:7858:
test_eq([[combine_path("./","..")]],"..") test_eq([[combine_path("./.","..")]],"..") test_eq([[combine_path("/","../../foo")]],"/foo") test_eq([[combine_path("./foobar/.","..")]],".") test_eq([[combine_path("/","foo","bar","gazonk")]],"/foo/bar/gazonk") test_eq([[combine_path("/", "foo", "")]], "/foo/") test_eq([[combine_path("/","/foo/bar/ga\11111zonk/../../")]],"/foo/") test_eq([[combine_path("/","/fo\1111/bar/ga\11111zonk/../../")]],"/fo\1111/") test_eq([[combine_path("/","/fo\1111/bar/gazonk/../../")]],"/fo\1111/")
+
+
// - combine_path_nt
test_eq([[combine_path_nt("/","/fo\1111/bar/gazonk/../../")]],"/fo\1111/")
-
test_eq([[combine_path_unix("/","/fo\1111/bar/gazonk/../../")]],"/fo\1111/")
+
test_eq([[combine_path_nt("a:/","/fo\1111/bar/gazonk/../../")]],"a:/fo\1111/") test_eq([[combine_path_nt("a:/", "/foo","bar")+combine_path_nt("/foo","bar")]], "a:/foo/bar/foo/bar")
-
// -
Stdio.append
_path
-
test_eq([[
Stdio.append
_path
("../foo/", "../bar") ]], "../foo/bar")
-
test
_
eq
(
[[ Stdio.append_path(
"
..
/
foo/
",
"
..
/
bar", "..
/
baz") ]], "../foo/
bar/
baz")
-
test_eq([[ Stdio.append_path("..
/
foo/", "
../
bar", "
../
baz
"
, "../fie/../faz"
)
]],
"
..
/
foo
/
bar/baz/faz
")
+
// -
combine
_path
_unix
+
test_eq([[
combine
_path_
unix
("/","/
fo\1111
/bar/
gazonk
/../../")]],"/
fo\1111
/")
-
+
// - compile
// - compile_file
-
// FIXME: add tests for compile_file
+
// - compile_string // see test for clone() cond([[all_constants()->thread_create]], [[ test_any([[ string file = #" /* * Attempt to trigg the lex.current_file == NULL bug.
pike.git/src/testsuite.in:7958:
multiset x = (<>); x[x] = 1; return equal (copy_value (x), x); ]], 1) test_any([[ array a=({0,0,0}); array b=copy_value(a); b[0]=17; b[1]=42; b[2]=128; return equal( ({0,0,0}), a) && equal( ({17,42,128}), b); ]], 1)
+
// - cos
+
// Tested in _math
+
+
// - cpp
+
// - crypt test_true(stringp(crypt("hej"))) test_true(crypt("hej",crypt("hej"))) test_true(crypt("hej","Oz5i0K.16qkgA")) test_true(crypt("hej","buf8/Z7taE6qs")) test_true(crypt("123456789", crypt("123456780"))) test_false(crypt("hej","hej")) test_false(crypt("h","hej")) test_false(crypt("hej","buf8/Z7taE6qst")) test_false(crypt("hej","buf8/Z7taE6q")) // - ctime test_eq(ctime(0)[-1],'\n')
-
+
// - decode_value
+
// - delay
+
// - describe_backtrace
+
// - describe_error
+
// - destruct test_do(add_constant("PROG",compile_string("int foo() { return 1; }"))); test_any([[object o=PROG(); destruct(o); return o]],0); test_any([[object o=PROG(); destruct(o); return objectp(o)]],0); test_any([[array(object) o=({PROG()}); destruct(o[0]); return o-({0}) ]],({})); test_any([[mapping o=(["foo":PROG()]); destruct(o["foo"]); return o["foo"]; ]],0); dnl test_any([[object t; mapping o=([t=PROG():"foo"]); destruct(t); return sizeof(o)]],0); test_do([[object t; array(object) o=({}); o+=({t=PROG()}); destruct(t); o=({});]]); test_do(add_constant("PROG"))
-
// -
Array.diff
-
test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),
-
({ 6, 7, 8, 9, 3, 4, 5, 1, 2, 0 })),
-
({ ({ ({ 0, 1, 2, 3, 4, 5 }),
-
({ 6, 7, 8, 9 }), ({}) }),
-
({ ({}), ({ 6, 7, 8, 9 }),
-
({ 3, 4, 5, 1, 2, 0 }) }) }))
-
test_equal(Array.diff(({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }),
-
({ 9, 7, 8, 4, 5, 6, 0, 1, 2, 3 })),
-
({ ({ ({}), ({ 0, 1, 2, 3 }),
-
({ 4, 5, 6, 7, 8, 9 }) }),
-
({ ({ 9, 7, 8, 4, 5, 6 }),
-
({ 0, 1, 2, 3 }), ({}) }) }))
-
test_equal(Array.diff("qadfgoksdfäojerjgöohjgdgkm"
/
"",
-
"xadfgokälojeorjgöoyjgdgkmzzz"
/
""),
-
({ ({ ({ "q" }), "adfgok"/"", "sdf"/"", ({ "ä" }), ({}),
-
"oje"/"", ({}), "rjgöo"/"", ({ "h" }), "jgdgkm"/"", ({}) }),
-
({ ({ "x" }), "adfgok"/"", ({}), ({ "ä" }), ({ "l" }),
-
"oje"/"", ({ "o" }), "rjgöo"/"", ({ "y" }), "jgdgkm"/"",
-
"zzz"/"" }) }))
-
test_equal(Array.diff("123.org"/"","http://123.org/"/""),
-
({ ({ ({}), "123.org"/"", ({}) }),
-
({ "http://"/"", "123.org"/"", ({ "/" }) }) }))
+
// -
dirname
+
//
Tested
in
lib
-
// -
Array.diff3 (note that the results would be different for a really optimal diff3)
-
test
_
equal(Array.diff3(({}),({"a","c"}),({"b","y"})),
-
({({({ })}),
-
({({"a","c"})}),
-
({({"b","y"})})}))
-
test_equal(Array.diff3(({"a"}),({"a","b"}),({"b"})),
-
({({({"a"}),({ })}),
-
({({"a"}),({"b"})}),
-
({({ }),({"b"})})}))
-
test_equal(Array.diff3(({"a"}),({"a","c"}),({"b"})),
-
({({({"a"}),({ })}),
-
({({"a"}),({"c"})}),
-
({({ }),({"b"})})}))
-
test_equal(Array.diff3(({"a","d"}),({"a","d"}),({"a","b"})),
-
({({({"a"}),({"d"})}),
-
({({"a"}),({"d"})}),
-
({({"a"}),({"b"})})}))
-
test_equal(Array.diff3(({"a","b"}),({"b"}),({"c","b"})),
-
({({({"a"}),({"b"})}),
-
({({ }),({"b"})}),
-
({({"c"}),({"b"})})}))
-
//
The
following is not optimal.
-
test
_
equal(Array.diff3(({"a","b"}),({"b"}),({"b","b"})),
-
({({({"a"}),({"b"}),({ })}),
-
({({ }),({"b"}),({ })}),
-
({({ }),({"b"}),({"b"})})}))
-
test
_
equal(Array.diff3(({"a","c","d"}),({"a","d","d"}),({"a","b"})),
-
({({({"a"}),({"c"}),({"d"}),({ })}),
-
({({"a"}),({ }),({"d"}),({"d"})}),
-
({({"a"}),({"b"}),({ }),({ })})}))
-
test_equal(Array.diff3(({"a","b","c"}),({"b","e","c"}),({"b","e","c"})),
-
({({({"a"}),({"b"}),({ }),({"c"})}),
-
({({ }),({"b"}),({"e"}),({"c"})}),
-
({({ }),({"b"}),({"e"}),({"c"})})}))
-
test_equal(Array.diff3(({"a","b","x"}),({"y","b","c","x"}),({"y","c","a"})),
-
({({({"a"}),({"b"}),({ }),({"x"})}),
-
({({"y"}),({"b"}),({"c"}),({"x"})}),
-
({({"y"}),({ }),({"c"}),({"a"})})}))
-
test_equal(Array.diff3(({"y","b","c","x"}),({"y","c","a"}),({"a","b","x"})),
-
({({({"y"}),({"b"}),({"c"}),({"x"})}),
-
({({"y"}),({ }),({"c"}),({"a"})}),
-
({({"a"}),({"b"}),({ }),({"x"})})}))
-
test_equal(Array.diff3(({"y","b","c","x"}),({"a","b","x"}),({"y","c","a"})),
-
({({({"y"}),({"b"}),({"c"}),({"x"})}),
-
({({"a"}),({"b"}),({ }),({"x"})}),
-
({({"y"}),({ }),({"c"}),({"a"})})}))
-
test_equal(Array.diff3(({"a","a","b","b"}),({"b","b","c","c"}),({"c","c","a","a"})),
-
({({({"a","a"}),({"b","b"}),({ }),({ })}),
-
({({ }),({"b","b"}),({"c","c"}),({ })}),
-
({({ }),({ }),({"c","c"}),({"a","a"})})}))
-
//
The
following is not optimal.
-
test_equal(Array.diff3(({"a","x","b","c"}),({"b","x","c"}),({"b","x","c"})),
-
({({({"a","x"}),({"b"}),({ }),({"c"})}),
-
({({ }),({"b"}),({"x"}),({"c"})}),
-
({({ }),({"b"}),({"x"}),({"c"})})}))
-
test_equal(Array.diff3(({"x","x","a","x"}),({"a","x","b","x"}),({"a","x","b","x"})),
-
({({({"x","x"}),({"a","x"}),({ })}),
-
({({ }),({"a","x"}),({"b","x"})}),
-
({({ }),({"a","x"}),({"b","x"})})}))
-
test_equal(Array.diff3(({"a","a","b"}),({"b","c"}),({"c","a","a"})),
-
({({({ }),({ }),({"a","a"}),({"b"})}),
-
({({"b"}),({"c"}),({ }),({ })}),
-
({({ }),({"c"}),({"a","a"}),({ })})}))
-
test_equal(Array.diff3(({"x","x","x","a"}),({"y","b"}),({"x","x","x","c"})),
-
({({({"x","x","x"}),({"a" })}),
-
({({ }),({"y","b"})}),
-
({({"x","x","x"}),({"c" })})}))
-
test_equal(Array.diff3(({"a","x","x","x","a"}),({"b","y","y","b"}),({"c","x","x","x","c"})),
-
({({({"a" }),({"x","x","x"}),({"a"})}),
-
({({"b","y","y","b"}),({ }),({ })}),
-
({({"c" }),({"x","x","x"}),({"c"})})}))
-
test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","d"}),({"a","y","y","y"})),
-
({({({"a"}),({"b","c" }),({"d"})}),
-
({({ }),({"x","x","x"}),({"d"})}),
-
({({"a"}),({"y","y","y"}),({ })})}))
-
test_equal(Array.diff3(({"a","b","c","d"}),({"a","x","x","d"}),({"a","y","y","y"})),
-
({({({"a"}),({"b","c" }),({"d"})}),
-
({({"a"}),({"x","x" }),({"d"})}),
-
({({"a"}),({"y","y","y"}),({ })})}))
-
test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","b"}),({"a","y","y","y"})),
-
({({({"a" }),({"b"}),({"c","d" })}),
-
({({"x","x","x"}),({"b"}),({ })}),
-
({({"a" }),({ }),({"y","y","y"})})}))
-
test_equal(Array.diff3(({"a","b","c","d"}),({"x","x","x","c"}),({"a","y","y","y"})),
-
({({({"a"}),({"b" }),({"c"}),({"d"})}),
-
({({ }),({"x","x","x"}),({"c"}),({ })}),
-
({({"a"}),({"y","y","y"}),({ }),({ })})}))
-
test_equal(Array.diff3(({"a","b","b","c","d"}),({"z","a","b","b","x"}),({"z","b","c","x"})),
-
({({({ }),({"a"}),({"b"}),({"b"}),({"c"}),({"d"})}),
-
({({"z"}),({"a"}),({"b"}),({"b"}),({ }),({"x"})}),
-
({({"z"}),({ }),({"b"}),({ }),({"c"}),({"x"})})}))
-
test_equal(Array.diff3(({"a","b","c","d"}),({"b","a","c","c"}),({"b","b","d","d","a"})),
-
({({({"a"}),({"b"}),({"c"}),({"d"}),({ }),({ }),({ })}),
-
({({ }),({"b"}),({ }),({ }),({ }),({"a"}),({"c","c"})}),
-
({({ }),({"b"}),({"b"}),({"d"}),({"d"}),({"a"}),({ })})}))
-
//
The
following is not optimal.
-
test_equal(Array.diff3(({"a"}),({"b","a"}),({"a","b","a"})),
-
({({({ }),({"a"}),({ })}),
-
({({"b"}),({"a"}),({ })}),
-
({({ }),({"a"}),({"b","a"})})}))
-
//
The
following is not optimal.
-
test_equal(Array.diff3(({"a","c"}),({"b","a","c"}),({"a","c","b","a","c"})),
-
({({({ }),({"a","c"}),({ })}),
-
({({"b"}),({"a","c"}),({ })}),
-
({({ }),({"a","c"}),({"b","a","c"})})}))
-
// The following is not optimal.
-
test_equal(Array.diff3(({"a","d"}),({"b","a","c"}),({"a","c","b","a","c"})),
-
({({({ }),({"a"}),({"d" }),({ })}),
-
({({"b"}),({"a"}),({ }),({"c"})}),
-
({({ }),({"a"}),({"c","b","a"}),({"c"})})}))
-
// The following is not optimal.
-
test_equal(Array.diff3(({"a","a"}),({"b","a","d","a"}),({"a","a","b","a","a"})),
-
({({({ }),({"a"}),({ }),({"a"}),({ })}),
-
({({"b"}),({"a"}),({"d"}),({"a"}),({ })}),
-
({({ }),({"a"}),({ }),({"a"}),({"b","a","a"})})}))
-
test_equal(Array.diff3(({"a"}),({"a","b"}),({"b","a"})),
-
({({({ }),({"a"}),({ })}),
-
({({ }),({"a"}),({"b"})}),
-
({({"b"}),({"a"}),({ })})}))
-
test_equal(Array.diff3(({"a","b"}),({"b","a"}),({"a"})),
-
({({({ }),({"a"}),({"b"})}),
-
({({"b"}),({"a"}),({ })}),
-
({({ }),({"a"}),({ })})}))
-
test_equal(Array.diff3(({"b","a"}),({"a"}),({"a","b"})),
-
({({({"b"}),({"a"}),({ })}),
-
({({ }),({"a"}),({ })}),
-
({({ }),({"a"}),({"b"})})}))
-
test_equal(Array.diff3(({"a","b"}),({"a"}),({"b","a"})),
-
({({({ }),({"a"}),({"b"})}),
-
({({ }),({"a"}),({ })}),
-
({({"b"}),({"a"}),({ })})}))
-
test_equal(Array.diff3(({"a","c"}),({"a","c","b","a"}),({"b","a","c"})),
-
({({({ }),({"a","c"}),({ })}),
-
({({ }),({"a","c"}),({"b","a"})}),
-
({({"b"}),({"a","c"}),({ })})}))
-
test_equal(Array.diff3(({"a","c","b","a"}),({"a","c"}),({"b","a","c"})),
-
({({({ }),({"a","c"}),({"b","a"})}),
-
({({ }),({"a","c"}),({ })}),
-
({({"b"}),({"a","c"}),({ })})}))
+
// -
encode
_
value
+
//
-
encode
_
value
_
canonic
+
//
-
endgrent
+
//
-
endpwent
+
//
-
enumerate
-
// - Array.dwim_sort_func
-
test_eq(Array.dwim_sort_func("1","a"), -1)
-
test_eq(Array.dwim_sort_func("1","1a"), -1)
-
test_eq(Array.dwim_sort_func("1","0a"), 1)
-
test_eq(Array.dwim_sort_func("1","1"), 0)
-
test_eq(Array.dwim_sort_func("1","01"), 0)
-
test_eq(Array.dwim_sort_func("1","2"), -1)
-
test_eq(Array.dwim_sort_func("10","2a"), 1)
-
+
// - equal // equal is already tested by this script
-
+
// - errno
+
+
// - error
+
// Tested in lib
+
+
// - exece
// - exit
-
// FIXME put test for exit here
+
-
// -
explode
-
test_equal(({"a","b","c",}), "anna bnna c"
/
"nna ")
-
test_equal(({"\3333","\3333","\3333",}), "\3333nna \3333nna \3333"
/
"nna
")
-
test_equal(({"\3333333","\3333333","\3333333",}),
"\3333333nna
\3333333nna \3333333"/"nna ")
-
test
_
equal(({"","",}),"hej"/"hej")
-
test_equal(({""}),""/"hej")
+
// -
exp
+
//
Tested
in
_
math
-
// -
fork()
-
//
FIXME:
add
tests
for
fork
+
// -
explode_path
+
//
-
file_stat
+
//
-
file_truncate
+
//
- filesystem_stat
-
cond([[all_constants()
-
>_verify_internals]],
-
[[
-
test_do(_verify_internals())
-
]])
+
//
-
filter
+
//
Tested
in lib/modules
-
+
// - find_call_out
+
+
// - floatp
+
// Tested in foop
+
+
// - floor
+
// Tested in _math
+
+
// - fork
+
// - function_name test_eq(function_name(a),"a") test_eq(function_name(function_name),0) // - function_object test_eq(function_object(a),this_object()) test_eq(function_name(function_object),0)
-
// -
get_
function
(actually in simulate.pike)
-
test
_
eq(a,
-
#pike 7.0
-
Simulate.get_function(this_object(),"a"))
-
test_eq(a,this_object()->a)
+
// - function_
program
-
+
// - functionp
+
// Tested in foop
+
+
// - gc
+
+
// - get_all_groups
+
// - get_all_users
+
// - get_dir
+
// - get_groups_for_user
+
// - get_weak_flag
+
// - getcwd
+
// - getegid
+
// - getenv
+
// - geteuid
+
// - getgid
+
// - getgrent
+
// - getgrgid
+
// - getgrnam
+
// - getgroups
+
// - gethostbyaddr
+
// - gethostbyname
+
// - gethostname
+
+
// - gethrtime
+
// See time
+
+
// - gethrvtime
+
// - getpgrp
+
// - getpid
+
// - getppid
+
// - getpwent
+
// - getpwnam
+
// - getpwuid
+
// - getsid
+
// - getuid
+
// - glob
+
// - gmtime
+
// - hardlink
+
+
// - has_index
+
define(test_has_index,[[test_true([[mixed foo=$1; return has_index(foo,$2)==$3;]])]])
+
test_has_index([[ ({}) ]],0,0)
+
test_has_index([[ ({}) ]],"foo",0)
+
test_has_index([[ ({ "a" }) ]],-1,0)
+
test_has_index([[ ({ "a" }) ]],"a",0)
+
test_has_index([[ ({ "a" }) ]],0,1)
+
test_has_index([[ ({ "a" }) ]],1,0)
+
test_has_index([[ ({ "a", "b" }) ]],1,1)
+
test_has_index([[ ([ "a":"A" ]) ]],4711,0)
+
test_has_index([[ ([ "a":"A" ]) ]],"a",1)
+
test_has_index([[ ([ "a":"A" ]) ]],"A",0)
+
test_has_index([[ ([ "a":"A", "b":"B", "c":"C" ]) ]],"b",1)
+
test_has_index([[ ([ "a":"A", "b":"B", "c":"C" ]) ]],"B",0)
+
test_has_index([[ class {}() ]],"foo",0)
+
test_has_index([[ (class{array _indices(){return({"a","b"});}})() ]],"b",1)
+
+
// - has_prefix
+
// - has_suffix
+
+
// - has_value
+
define(test_has_value,[[test_true([[mixed foo=$1; return has_value(foo,$2)==$3;]])]])
+
test_has_value([[ ({}) ]],0,0)
+
test_has_value([[ ({}) ]],"foo",0)
+
test_has_value([[ ({ "a" }) ]],-1,0)
+
test_has_value([[ ({ "a" }) ]],"a",1)
+
test_has_value([[ ({ "a" }) ]],0,0)
+
test_has_value([[ ({ "a", "b" }) ]],"b",1)
+
test_has_value([[ ([ "a":"A" ]) ]],4711,0)
+
test_has_value([[ ([ "a":"A" ]) ]],"a",0)
+
test_has_value([[ ([ "a":"A" ]) ]],"A",1)
+
test_has_value([[ ([ "a":"A", "b":"B", "c":"C" ]) ]],"B",1)
+
test_has_value([[ ([ "a":"A", "b":"B", "c":"C" ]) ]],"b",0)
+
test_has_value([[ class {}() ]],"foo",0)
+
test_has_value([[ (class{array _values(){return({"a","b"});}})() ]],"b",1)
+
// - hash test_true(intp(hash("foo"))) test_true(intp(hash("foo",10))) test_true(hash("foo",10)<10) test_true(hash("bar",10)<10) test_true(hash("gazonk",10)<10) test_eq(hash("foobargazonk"),hash("foobargazonk")) test_false(hash(""))
-
// -
implode
-
test
_
eq([[({})*""]],"")
-
test
_
eq([[("foo"/"o")*"o"]],"foo")
-
test_eq([[({"foo","bar"})*"-"]],"foo-bar")
-
test_eq([[({"foo",
0
,"bar"})*"-"]],"foo-bar")
-
test_eq([[({1.0,"foo",0,"bar",this_object(),([])})*"-"]],"foo-bar")
-
test_eq([[({"f","o","o"})*""]],"foo")
+
// -
hash
_
7
_0
// - indices test_equal(indices("foo"),({0,1,2})) test_equal(indices(({'f','o','o'})),({0,1,2})) test_equal(Array.sort_array(indices(([7:3,8:9,99:12]))),({7,8,99})) test_equal(Array.sort_array(indices((<7,8,99>))),({7,8,99})) test_equal(mkmultiset(indices(class{constant a="a"; constant b="b";}())), (<"a","b">))
-
// -
Array.longest_ordered_sequence
-
test_equal(Array.longest_ordered_sequence("dfgaokäpojghadjjioijrgxcvb"
/
""),
-
({ 0, 1, 2, 10, 11, 16, 18, 19, 20, 22 }));
+
// -
initgroups
+
/
/
-
innetgrp
-
+
// - int2char
+
// - int2hex
+
// Tested in String
+
+
// - intp
+
// Tested in foop
+
+
// - is_absolute_path
+
// Tested in lib
+
+
// - kill
+
// - load_module
+
// - localtime
+
+
// - log
+
// Tested in _math
+
// - lower_case test_equal(lower_case("foo"),"foo") test_equal(lower_case("Foo"),"foo") test_equal(lower_case("Foo1234-*~\n"),"foo1234-*~\n") test_equal(lower_case("foo\x3000"),"foo\x3000") test_equal(lower_case("Foo\x3000"),"foo\x3000") test_equal(lower_case("Foo1234-*~\n\x3000"),"foo1234-*~\n\x3000") test_equal(lower_case("foo\x13000"),"foo\x13000") test_equal(lower_case("Foo\x13000"),"foo\x13000") test_equal(lower_case("Foo1234-*~\n\x13000"),"foo1234-*~\n\x13000")
pike.git/src/testsuite.in:8310:
0x1fa0, 0x1fa0, 0x1fb0, 0x1fb2, 0x1fb3, 0x1fb4, 0x1fb0, 0x1f70, 0x1fb3, 0x1fbd, 0x1fbe, 0x1fbf, 0x1fc3, 0x1fc4, 0x1f72, 0x1fc3, 0x1fcd, 0x1fd0, 0x1fd2, 0x1fd0, 0x1f76, 0x1fdd, 0x1fe0, 0x1fe2, 0x1fe5, 0x1fe6, 0x1fe0, 0x1f7a, 0x1fe5, 0x1fed, 0x1ff3, 0x1ff4, 0x1f78, 0x1f7c, 0x1ff3, 0x1ffd, 0x03c9, 0x2127, 0x006b, 0x00e5, 0x212c, 0x2170, 0x2180, 0x24d0, 0x24d0, 0x24ea, 0xff41, 0xff3b, 0xff41, 0xff5b, 0x010428, 0x010426, 0x010428, 0x01044e, }))
+
// - m_delete
+
// - map
-
+
// - mappingp
+
// Tested in foop
+
+
// - master
+
+
// - max
+
// - min
+
// Tested in _math
+
+
// - mkdir
+
// - mkmapping
+
// - mkmultiset
+
// - mktime
+
+
// - multisetp
+
// Tested in foop
+
+
// - mv
+
// - next_object test_true(objectp(next_object())) test_any(int e;object o=next_object(); for(e=0;e<10000 && (o || objectp(o));e++) o=next_object(o); return o,0)
-
+
// - normalize_path
+
// Tested in lib
+
// - object_program test_true(programp(object_program(this_object())))
-
+
// - object_variablep
+
// - openlog
+
+
// - pow
+
// Tested in _math
+
+
// - programp
+
// Tested in foop
+
+
// - putenv
+
// Tested in lib
+
// - query_num_arg test_eq(lambda(int ... q) { return query_num_arg(); }(),0) test_eq(lambda(int ... q) { return query_num_arg(); }(1),1) test_eq(lambda(int ... q) { return query_num_arg(); }(1,1),2) test_eq(lambda(int ... q) { return query_num_arg(); }(1,1,1),3) test_eq(lambda(int ... q) { return query_num_arg(); }(1,1,1,1),4) // - random test_any([[int e,d;for(e=0;e<1000;e++){d=random(10); if(d<0 || d>=10) return 0;} return 1]],1) test_eq([[ random( ({11,21,31,41}) ) % 10 ]], 1)
pike.git/src/testsuite.in:8346:
test_eq([[ random( (<11,21,31,41>) ) % 10 ]], 1) test_eq([[ `-( @random( ([11:21,31:41]) )) ]], -10) test_eq([[ `-( @random( ([11:21,31:41]) )) ]], -10) test_eq([[ `-( @random( ([11:21,31:41]) )) ]], -10) test_eq([[ `-( @random( ([11:21,31:41]) )) ]], -10) test_eval_error([[ return random( ({}) ) ]]) test_eval_error([[ return random( (<>) ) ]]) test_eval_error([[ return random( ([]) ) ]]) test_eq([[ random( class() { int _random() { return 17; }}()) ]], 17)
-
// random_seed
+
//
-
random_seed
test_do(int p; foreach(({1,2,3,4,5}),p) random_seed(p)) test_eq([[random_seed(17),random(20000)]],[[random_seed(17),random(20000)]]) test_eq([[random_seed(18),random(20000)]],[[random_seed(18),random(20000)]]) test_eq([[random_seed(19),random(20000)]],[[random_seed(19),random(20000)]])
-
+
// - random_string
+
// - readlink
+
// - remove_call_out
+
+
// - remove_include_path
+
// - remove_module_path
+
// - remove_program_path
+
// Tested in lib
+
// - replace test_eq(replace("foo","f","\x9999"),"\x9999oo") test_eq(replace("foo",({"f"}),({"\x9999"})),"\x9999oo") test_eq([[replace("11013",({"1","100","108","13","1069","1067","106","10"}), ({"A","B","C","D","E","F","G","H"}))]],"AHD") test_eq([[replace("1264412124",({"126","124","12","122","1260"}), ({"13333","13335","883","13329","226709"}))]],"133334488313335") test_eq(replace("foobargazonk","o","-"),"f--bargaz-nk") test_eq(replace("foobargazonk",({"o","a"}),({"()","<>"})),"f()()b<>rg<>z()nk") test_eq(replace("f--barf--",({"f--","f--bar"}),({"f--bar","f--"})),"f--f--bar")
pike.git/src/testsuite.in:8464:
test_eq(replace("f\777\777barf\777\777",({"f\777\777bar","f\777\777"}),({"f\777\777","f\777\777bar"})),"f\777\777f\777\777bar") test_eq(replace("f\7777777\7777777bargaz\7777777nk","\7777777","-"),"f--bargaz-nk") test_eq(replace("f\7777777\7777777bargaz\7777777nk",({"\7777777","a"}),({"()","<>"})),"f()()b<>rg<>z()nk") test_eq(replace("f\7777777\7777777barf\7777777\7777777",({"f\7777777\7777777","f\7777777\7777777bar"}),({"f\7777777\7777777bar","f\7777777\7777777"})),"f\7777777\7777777f\7777777\7777777bar") test_eq(replace("f\7777777\7777777barf\7777777\7777777",({"f\7777777\7777777bar","f\7777777\7777777"}),({"f\7777777\7777777","f\7777777\7777777bar"})),"f\7777777\7777777f\7777777\7777777bar") test_equal(replace(({1,2,3,4,5,1,2,3,4}),3,-1),({1,2,-1,4,5,1,2,-1,4})) test_equal(replace(([1:2,3:4,5:1,2:3]),3,-1),([1:2,3:4,5:1,2:-1]))
+
// - replace_master
+
// - reverse test_eq(reverse("reverse"),"esrever") test_eq(reverse("r\777v\777rs\777"),"\777sr\777v\777r") test_eq(reverse("r\7777777v\7777777rs\7777777"),"\7777777sr\7777777v\7777777r") test_eq(reverse(""),"") test_eq(reverse("a"),"a") test_equal(reverse(({1,5,9})),({9,5,1})) test_equal(reverse(({})),({})) test_equal(reverse(({42})),({42})) test_equal(reverse(({42,4711})),({4711,42})) test_equal(reverse(0x12345678),0x1e6a2c48)
-
// -
rusage
-
test_true(
-
#pike 7.4
-
arrayp(rusage()))
-
test_true(
-
#pike 7.4
-
sizeof(rusage())>28)
+
// -
rm
-
// -
has_index
-
define(test_has_index,[[test_true([[mixed
foo=$1;
return
has
_
index(foo,$2)==$3;]])]])
-
test_has_index([[ ({}) ]],0,0)
-
test_has_index([[ ({}) ]],"foo",0)
-
test_has_index([[ ({ "a" }) ]],-1,0)
-
test_has_index([[ ({ "a" }) ]],"a",0)
-
test_has_index([[ ({ "a" }) ]],0,1)
-
test_has_index([[ ({ "a" }) ]],1,0)
-
test_has_index([[ ({ "a", "b" }) ]],1,1)
-
test_has_index([[ ([ "a":"A" ]) ]],4711,0)
-
test_has_index([[ ([ "a":"A" ]) ]],"a",1)
-
test_has_index([[ ([ "a":"A" ]) ]],"A",0)
-
test_has_index([[ ([ "a":"A", "b":"B", "c":"C" ]) ]],"b",1)
-
test_has_index([[ ([ "a":"A", "b":"B", "c":"C" ]) ]],"B",0)
-
test_has_index([[ class {}() ]],"foo",0)
-
test_has_index([[ (class{array _indices(){return({"a","b"});}})() ]],"b",1)
+
// -
round
+
//
Tested
in
_
math
-
// -
has_value
-
define(test_has_value,[[test_true([[mixed foo=$1; return has_value(foo,$2)==$3;]])]])
-
test_has_value([[ ({}) ]],0,0)
-
test_has_value([[ ({}) ]],"foo",0)
-
test_has_value([[ ({ "a" }) ]],-1,0)
-
test_has_value([[ ({ "a" }) ]],"a",1)
-
test_has_value([[ ({ "a" }) ]],0,0)
-
test_has_value([[ ({ "a", "b" }) ]],"b",1)
-
test_has_value([[ ([ "a":"A" ]) ]],4711,0)
-
test_has_value([[ ([ "a":"A" ]) ]],"a",0)
-
test_has_value([[ ([ "a":"A" ]) ]],"A",1)
-
test_has_value([[ ([ "a":"A", "b":"B", "c":"C" ]) ]],"B",1)
-
test_has_value([[ ([ "a":"A", "b":"B", "c":"C" ]) ]],"b",0)
-
test_has_value([[ class {}() ]],"foo",0)
-
test_has_value([[ (class{array _values(){return({"a","b"});}})() ]],"b",1)
+
// -
rows
// - search test_eval_error(return search("foolbar","o",-10)) test_eval_error(return search("foolbar","o",2983742)) test_eq(search("foolbar","gazonk"),-1) test_eq(search("qowiueproqiuweproiwqueoplkjljlklksjjriwueproiuwerowieu","lkjljlklksjj"),24) test_eq(search("lkjljlklksjjriwueproiuwerlskjdvlaskjfowieu","lkjljlklksjj"),0) test_eq(search("aaaaaaaaaaaaaaaaaaaaaaaalkjljlklksjj","lkjljlklksjj"),24) test_eq(search("foobargazonk","oo"),1) test_eq(search("foobargazonk","o",3),9)
pike.git/src/testsuite.in:8628:
test_search4("SUNE") test_search4("kapit\344l>") test_search4("-------------------+") test_search4("\345-------------------") test_search4(sprintf("%'argel-bargel glop-glyf?'2000n")) test_search4("\34567-------------------") test_search4("\345677777-------------------") test_search4("kapit\3333l>") test_search4("kapit\3333333l>")
+
// - rusage
+
test_true(
+
#pike 7.4
+
arrayp(rusage()))
+
test_true(
+
#pike 7.4
+
sizeof(rusage())>28)
-
// -
sprintf
-
test
_
eq(sprintf("%.1f",31415.9267),"31415.9")
-
test_eq(sprintf("%.0f",31415.9267),"31416")
-
test_eq(sprintf("%.
-
1f",31415.9267),"31420")
-
test
_
eq(sprintf("%.-2f",31415.9267),"31400")
-
test
_
eq(sprintf("%.-2f",-31415.9267),"-31400")
-
test_eq(sprintf("%.
-
10f",31415.9267),"0")
-
test_eq(sprintf("%20.
-
3f",
31415.92670),"
31000")
-
test_eq(sprintf("%t",
({"a"})),
"array")
-
test_any([[array(string)
a
= ({"a"}); return sprintf("%t", a);]], "array")
-
test_eq(sprintf("%t",
0),
"int")
-
test_any([[array(string)
a
= 0; return sprintf("%t", a);]], "int")
+
// -
set
_
priority
+
//
-
set
_
weak
_
flag
+
//
-
setegid
+
//
-
seteuid
+
//
-
setgid
+
//
-
setgrent
+
//
-
setgroups
+
//
-
setpgrp
+
//
-
setpwent
+
//
-
setresgid
+
//
-
setresuid
+
//
-
setsid
+
//
-
setuid
-
+
// - sgn
+
// Tested in _math
+
+
// - signal
+
// - signame
+
// - signum
+
+
// - sin
+
// Tested in _math
+
// - sizeof test_eq(sizeof("felbar"),6) test_eq(sizeof(({"fulbar","gazonk",7})),3) test_eq(sizeof(([8:3,6:6,7:0])),3) test_eq(sizeof((<8,7,6,5,4,7>)),6) test_eq([[ sizeof( class { int _sizeof() { return 17; } }() ) ]], 17) // - sleep test_do(sleep(1)) test_do(sleep(0.5)) test_any([[int x=time(); sleep(2); return x!=time()]],1) test_any([[int x=time(); sleep(2); return x!=time()]],1)
-
+
// - sort
+
+
// - sprintf
+
// Tested in sprintf
+
+
// - sqrt
+
// Tested in _math
+
+
// - strerror
+
// - string_to_unicode, unicode_to_string test_eq(string_to_unicode("foo"), "\0f\0o\0o") test_eq(string_to_unicode("blä"), "\0b\0l\0ä") test_eq(string_to_unicode("\77077"), "\176\77") test_eq(string_to_unicode("\777077"), "\330\277\336\77") test_eq(string_to_unicode("\777077foo\77077\777077blä\777077"), "\330\277\336\77\0f\0o\0o\176\77\330\277\336\77\0b\0l\0ä\330\277\336\77") test_eq(unicode_to_string("\330\277\336\77\0f\0o\0o\176\77\330\277\336\77\0b\0l\0ä\330\277\336\77"), "\777077foo\77077\777077blä\777077") test_eq(unicode_to_string("\330\277\336\77"), "\777077") test_eq(unicode_to_string("\176\77"), "\77077") test_eq(unicode_to_string("\0b\0l\0ä"), "blä")
pike.git/src/testsuite.in:8712:
test_eval_error(return utf8_to_string("\367\207\270")); test_eval_error(return utf8_to_string("\347\270")); test_eval_error(return utf8_to_string("\303")); test_eval_error(return utf8_to_string("\376\203\270\277\207\270a")); test_eval_error(return utf8_to_string("\374\270\277\207\270a")); test_eval_error(return utf8_to_string("\370\277\207\270a")); test_eval_error(return utf8_to_string("\367\207\270a")); test_eval_error(return utf8_to_string("\347\270a")); test_eval_error(return utf8_to_string("\303a"));
-
// -
sum
-
test_eq(`+(1,1),2)
-
test_eq(`+(1,-2),-1)
-
test_eq(`+(-2,-2),-4)
-
test_eq(`+("hi","there"),"hithere")
+
// -
stringp
+
// Tested in foop
-
test_eq(`+("hi\777","there"),"hi\777there")
-
test_eq(
`+("hi"
,
"there\777"
)
,"hithere\777")
+
// - strlen
+
test_eq(
strlen
,
sizeof
)
-
test_eq(`+("hi\7777777","there"),"hi\7777777there")
-
test_eq(`+("hi","there\7777777"),"hithere\7777777")
+
// - symlink
+
// - syslog
-
test_eq(`+("human","number",666),"humannumber666")
-
test_eq(`+("human","number",666),"humannumber666")
-
test_eq(`+("human","number",666),"humannumber666")
-
test_eq(`+("human","number",666,111),"humannumber666111")
-
test_eq(`+("humannumber",`+(666+111)),"humannumber777")
-
test_eq(`+("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y"),"abcdefghijklmnopqrstuvxy")
-
test_eq(`+(1.0+1.0),2.0)
-
test_eq(`+(1.0,
-
1.0),0.0)
-
test
_
eq(`+(-1.0,-1.0),-2.0)
-
test_equal(`+(({1,2,3}),({4,5,6})),({1,2,3,4,5,6}))
-
test_equal(`+((<1,2,3,4>),(<4,5,6>)),(<1,2,3,4,4,5,6>))
-
test_equal(`+(([0:1,3:6]),([5:2,3:6])),([0:1,3:6,3:6,5:2]))
+
//
-
tan
+
// Tested in
_
math
-
test_any(return((1+2+3)-(1+2-3)), 6)
-
+
// - this_object and this test_true(objectp(this_object())) test_program([[ string _sprintf() {return "g";} class A { string _sprintf() {return "A";} class B { string _sprintf() {return "B";} mixed f() {
pike.git/src/testsuite.in:8826:
class A { class B { mixed f() { return typeof (this_object (1)) != typeof (this_object (0)); } } } int a() {return A()->B()->f();} ]])
+
// - this_thread
+
// - thread_create
+
// - thread_local
+
// - throw test_eq(20,catch(throw(a())))
-
// - catch compile-errors
-
test_any([[ master()->set_inhibit_compile_errors(lambda(){});mixed res = catch{compile_string("dfasfqw123");};master()->set_inhibit_compile_errors(0); return arrayp(res)||objectp(res); ]], 1)
-
-
// catch
-
test_false([[class X { string test(string foo) { catch { return lower_case(foo); }; return foo; }}()->test(0); ]])
-
+
// - time test_true(time()) test_true(time(1)) test_true(intp(time())) test_true(intp(time(1))) test_true(floatp(time(2)))
-
+
// gethrtime() may gethrtime(), RDTSC or gettimeofday // sleep uses a combination of select/poll and the above // time() uses gettimeofday test_any([[ float tts=2.0; int t0=time(); float t1=time(t0); int hrt1=gethrtime(); sleep(tts);
pike.git/src/testsuite.in:8870:
if (e<tts-0.1 || e>tts+0.1) r+=({sprintf("hrtime %.6f, %+.6f",e,e-tts)}); if (f<tts-0.1 || f>tts+0.1) r+=({sprintf("timeofday %.6f, %+.6f",f,f-tts)}); if (sizeof(r)) return r*" / "; return "no error"; ]],"no error")
-
-
// Stdio.FILE gets/ngets tests
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp","hej\nhopp\ngazonk");
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
array v=({});
-
while (string s=r->gets())
-
v+=({s});
-
return v;
-
}()
-
]],({"hej","hopp","gazonk"}))
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp", // 59 is a prime number:
-
"abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ!\n"*400);
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
array v=({});
-
while (string s=r->gets())
-
v+=({s});
-
return v;
-
}()
-
]],({"abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ!"})*400)
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp",
-
"abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ!\n"*400);
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
return r->ngets();
-
}()
-
]],({"abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ!"})*400)
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp", "\n"*400);
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
array v=({});
-
while (string s=r->gets())
-
v+=({s});
-
return v;
-
}()
-
]],({""})*400)
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp","\n"*400);
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
return r->ngets();
-
}()
-
]],({""})*400)
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp","hej\nhopp\ngazonk\n");
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
array v=({});
-
while (string s=r->gets())
-
v+=({s});
-
return v;
-
}()
-
]],({"hej","hopp","gazonk"}))
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp","hej\nhopp\ngazonk\n");
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
return r->ngets();
-
}()
-
]],({"hej","hopp","gazonk"}))
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp","hej\nhopp\ngazonk");
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
return r->ngets();
-
}()
-
]],({"hej","hopp","gazonk"}))
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp","hej\nhopp\ngazonk\n");
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
return r->ngets(100);
-
}()
-
]],({"hej","hopp","gazonk"}))
-
-
test_equal([[
-
lambda()
-
{
-
Stdio.write_file("testsuite.tmp","hej\nhopp\ngazonk");
-
Stdio.FILE r=Stdio.FILE("testsuite.tmp","r");
-
return r->ngets(100);
-
}()
-
]],({"hej","hopp","gazonk"}))
-
-
test_true(rm("testsuite.tmp"))
-
+
// - trace test_do(trace(0)) test_eq(trace(0),0)
-
+
// - ualarm
+
// - umask
+
// - uname
+
+
// - unicode_to_string
+
// See string_to_unicode
+
// - upper_case test_equal(upper_case("fooq"),"FOOQ") test_equal(upper_case("FooR"),"FOOR") test_equal(upper_case("Foo1234-*~\n"),"FOO1234-*~\n") test_equal(upper_case("fooq\x3000"),"FOOQ\x3000") test_equal(upper_case("FooR\x3000"),"FOOR\x3000") test_equal(upper_case("Foo1234-*~\n\x3000"),"FOO1234-*~\n\x3000") test_equal(upper_case("fooq\x13000"),"FOOQ\x13000") test_equal(upper_case("FooR\x13000"),"FOOR\x13000") test_equal(upper_case("Foo1234-*~\n\x13000"),"FOO1234-*~\n\x13000")
pike.git/src/testsuite.in:9074:
0x1fa8, 0x1fa8, 0x1fb8, 0x1fb2, 0x1fbc, 0x1fb4, 0x1fb8, 0x1fba, 0x1fbc, 0x1fbd, 0x0399, 0x1fbf, 0x1fcc, 0x1fc4, 0x1fc8, 0x1fcc, 0x1fcd, 0x1fd8, 0x1fd2, 0x1fd8, 0x1fda, 0x1fdd, 0x1fe8, 0x1fe2, 0x1fec, 0x1fe6, 0x1fe8, 0x1fea, 0x1fec, 0x1fed, 0x1ffc, 0x1ff4, 0x1ff8, 0x1ffa, 0x1ffc, 0x1ffd, 0x2126, 0x2127, 0x212a, 0x212b, 0x212c, 0x2160, 0x2180, 0x24b6, 0x24b6, 0x24ea, 0xff21, 0xff3b, 0xff21, 0xff5b, 0x010400, 0x010426, 0x010400, 0x01044e, }))
+
// - utf8_to_string
+
// See string_to_utf8
-
+
// - utime
+
// - values test_equal(values("foo"),({'f','o','o'})) test_equal(values(({'f','o','o'})),({'f','o','o'})) test_equal(Array.sort_array(values(([7:3,8:9,99:12]))),({3,9,12})) test_equal(values((<7,8,99>)),({1,1,1})) test_equal(mkmultiset(values(class{ constant a="a"; constant b="b";}())), (<"a","b">))
-
+
// - version
+
test_equal(version(), "Pike v"+__REAL_MAJOR__+"."+__REAL_MINOR__+" release "+__REAL_BUILD__)
+
+
// - werror
+
// - write
+
// - zero_type test_eq(zero_type(0),0) test_eq(zero_type(([])[7]),1) test_eq(zero_type(UNDEFINED), 1) test_true([[lambda (int|void a) { return zero_type(a); }()]]) test_true([[lambda () {mixed a; return zero_type(a = ([])[0]);}()]]) test_true([[lambda () {mapping a=([]); return zero_type(a[0] = ([])[0]);}()]]) test_true([[zero_type (lambda () {return ([])[0];}())]])
-
+
+
+
test_program(int b=10; mixed a() { return 1; }) test_program(mixed b=10; mixed a() { return 1;}) test_define_program(test,[[int q,w,e,r,t; mixed foo() { return 10; }]]) test_program(inherit test; mixed a() { return foo()==10; }) test_program(inherit test; mixed a() { return test::foo()==10; }) test_program(inherit test : bar; mixed a() { return bar::foo()==10; }) test_define_program(test2,[[int z,x,c,v,b; mixed bar() { return 11; }]]) test_program(inherit test; inherit test2; mixed a() { return foo()==10 && bar()==11; })
pike.git/src/testsuite.in:9118:
test_program(inherit test; inherit test2; mixed a() { w=20; b=22; return getw()==20 && getb()==22; }) test_program(inherit test; inherit test2; mixed a() { setw(20); setb(22); return w==20 && b==22; }) test_program(inherit test2; inherit test; mixed a() { w=20; b=22; return getw()==20 && getb()==22; }) test_program(inherit test2; inherit test; mixed a() { setw(20); setb(22); return w==20 && b==22; }) test_do(add_constant("test")) test_do(add_constant("test2")) test_eval_error(return class c{int i;void foo(){ destruct(this_object());i=0;return i;}}()->foo())
-
//
master
defined
functions
+
//
-
get_function
(actually in simulate.pike)
+
test_eq(a,
+
#pike 7.0
+
Simulate.get_function(this_object(),"a"))
+
test_eq(a,this_object()->a)
-
test_eq(dirname("
/
a
/
b/"),"/a/b")
-
test_
eq
(
dirname
(
"/a/b"
)
,"/a")
-
test
_
eq(dirname("/a/"),"/a")
-
test
_
eq(dirname("/a"),"/")
-
test
_
eq
(
dirname
(
"/"
)
,"/"
)
-
test
_
eq
(
dirname(
"")
,"")
-
test_eq
(
dirname("a/b/"
)
,"a/b")
-
test
_
eq
(
dirname("a/b"
)
,"a")
-
test_eq
(
dirname("a/"
)
,"a")
-
test_eq
(
dirname("a"
),
""
)
+
//
- catch compile-errors
+
test_
any
(
[[ master
()
->set
_
inhibit
_
compile
_
errors
(
lambda
()
{}
)
;mixed res = catch{compile
_
string
("
dfasfqw123
")
;};master
()
->set
_
inhibit_compile_errors
(
0
)
; return arrayp
(
res
)
||objectp
(
res
)
; ]]
,
1
)
-
test_eq(basename("
/
a
/
b"),"b")
-
test_
eq
(
basename("/a/"),"")
-
test
_eq
(
basename("/a"
)
,"a")
-
test
_
eq
(
basename("/"
)
,"")
-
test_eq
(
basename("a/b"
)
,"b")
-
test
_eq
(
basename("a/"
)
,""
)
-
test_eq(basename("a"),"a")
-
test_eq(basename(""),"")
+
//
- catch
+
test_
false
(
[[class X { string
test(
string foo
)
{ catch { return lower
_
case
(
foo
)
; }; return foo; }}
()
->
test(
0
)
; ]]
)
-
+
// Pike modules // - this failed in Calendar.Timezone test_compile( [[ array tz_ux(int ux) { if (ux<-0x80000000 || ux>0x7fffffff) error("bah\n");