Skip to content
Snippets Groups Projects
Commit 3fcd53eb authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Defeated type checks in the has_index()/has_value() tests. Fixed a

typo.

Rev: src/testsuite.in:1.263
parent aa148881
No related branches found
No related tags found
No related merge requests found
test_true([["$Id: testsuite.in,v 1.262 2000/01/20 23:12:01 noring Exp $"]]); test_true([["$Id: testsuite.in,v 1.263 2000/01/24 03:28:29 mast Exp $"]]);
cond([[all_constants()->_verify_internals]], cond([[all_constants()->_verify_internals]],
[[ [[
...@@ -3726,33 +3726,33 @@ test_true(arrayp(rusage())) ...@@ -3726,33 +3726,33 @@ test_true(arrayp(rusage()))
test_true(sizeof(rusage())>0) test_true(sizeof(rusage())>0)
// - has_index // - has_index
test_false([[ has_index(({}), 0) ]]) test_false([[ has_index([mixed] ({}), 0) ]])
test_false([[ has_index(({}), "foo") ]]) test_false([[ has_index([mixed] ({}), "foo") ]])
test_false([[ has_index(({ "a" }), -1) ]]) test_false([[ has_index([mixed] ({ "a" }), -1) ]])
test_false([[ has_index(({ "a" }), "a") ]]) test_false([[ has_index([mixed] ({ "a" }), "a") ]])
test_true([[ has_index(({ "a" }), 0) ]]) test_true([[ has_index([mixed] ({ "a" }), 0) ]])
test_false([[ has_index(({ "a" }), 1) ]]) test_false([[ has_index([mixed] ({ "a" }), 1) ]])
test_true([[ has_index(({ "a", "b" }), 1) ]]) test_true([[ has_index([mixed] ({ "a", "b" }), 1) ]])
test_false([[ has_index(([ "a":"A" ]), 4711) ]]) test_false([[ has_index([mixed] ([ "a":"A" ]), 4711) ]])
test_true([[ has_index(([ "a":"A" ]), "a") ]]) test_true([[ has_index([mixed] ([ "a":"A" ]), "a") ]])
test_false([[ has_index(([ "a":"A" ]), "A") ]]) test_false([[ has_index([mixed] ([ "a":"A" ]), "A") ]])
test_true([[ has_index(([ "a":"A", "b":"B", "c":"C" ]), "b") ]]) test_true([[ has_index([mixed] ([ "a":"A", "b":"B", "c":"C" ]), "b") ]])
test_false([[ has_index(([ "a":"A", "b":"B", "c":"C" ]), "B") ]]) test_false([[ has_index([mixed] ([ "a":"A", "b":"B", "c":"C" ]), "B") ]])
test_eval_error([[ has_index((class {})(), "foo") ]]) test_eval_error([[ has_index((class {})(), "foo") ]])
test_true([[has_index((class{array _indices(){return({"a","b"});}})(),"b")]]) test_true([[has_index((class{array _indices(){return({"a","b"});}})(),"b")]])
// - has_value // - has_value
test_false([[ has_value(({}), 0) ]]) test_false([[ has_value([mixed] ({}), 0) ]])
test_false([[ has_value(({}), "foo") ]]) test_false([[ has_value([mixed] ({}), "foo") ]])
test_false([[ has_value(({ "a" }), -1) ]]) test_false([[ has_value([mixed] ({ "a" }), -1) ]])
test_true([[ has_value(({ "a" }), "a") ]]) test_true([[ has_value([mixed] ({ "a" }), "a") ]])
test_false([[ has_value(({ "a" }), 0) ]]) test_false([[ has_value([mixed] ({ "a" }), 0) ]])
test_true([[ has_value(({ "a", "b" }), "b") ]]) test_true([[ has_value([mixed] ({ "a", "b" }), "b") ]])
test_false([[ has_value(([ "a":"A" ]), 4711) ]]) test_false([[ has_value([mixed] ([ "a":"A" ]), 4711) ]])
test_true([[ has_value(([ "a":"A" ]), "A") ]]) test_true([[ has_value([mixed] ([ "a":"A" ]), "A") ]])
test_false([[ has_value(([ "a":"A" ]), "a") ]]) test_false([[ has_value([mixed] ([ "a":"A" ]), "a") ]])
test_true([[ has_value(([ "a":"A", "b":"B", "c":"C" ]), "B") ]]) test_true([[ has_value([mixed] ([ "a":"A", "b":"B", "c":"C" ]), "B") ]])
test_false([[ has_value(([ "a":"A", "b":"B", "c":"C" ]), "b") ]]) test_false([[ has_value([mixed] ([ "a":"A", "b":"B", "c":"C" ]), "b") ]])
test_eval_error([[ has_value((class {})(), "foo") ]]) test_eval_error([[ has_value((class {})(), "foo") ]])
test_true([[has_value((class{array _values(){return({"a","b"});}})(),"b")]]) test_true([[has_value((class{array _values(){return({"a","b"});}})(),"b")]])
...@@ -3795,7 +3795,7 @@ test_do([[ ...@@ -3795,7 +3795,7 @@ test_do([[
{ {
m = _m; m = _m;
} }
} };
mapping m = ([ ]); mapping m = ([ ]);
C o = C(m); C o = C(m);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment