mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Added _containsKey() and _containsValue()
This commit is contained in:
@@ -46,6 +46,27 @@ import compound;
|
||||
}
|
||||
|
||||
|
||||
//test containsKey
|
||||
{
|
||||
var d = ["one": 1, "two": 2];
|
||||
|
||||
assert d.containsKey("one") == true, "dictionary.containsKey() == true failed";
|
||||
assert d.containsKey("three") == false, "dictionary.containsKey() == false failed";
|
||||
}
|
||||
|
||||
|
||||
//test containsValue
|
||||
{
|
||||
var a = [1, 2, 3];
|
||||
var d = ["one": 1, "two": 2];
|
||||
|
||||
assert a.containsValue(1) == true, "array.containsValue() == true failed";
|
||||
assert a.containsValue(5) == false, "array.containsValue() == false failed";
|
||||
assert d.containsValue(1) == true, "dictionary.containsValue() == true failed";
|
||||
assert d.containsValue(3) == false, "dictionary.containsValue() == false failed";
|
||||
}
|
||||
|
||||
|
||||
//test every
|
||||
{
|
||||
var a = [1, 2, 3];
|
||||
|
||||
Reference in New Issue
Block a user