expand tests, kill mutants

This commit is contained in:
Timo Hocker 2020-04-28 08:27:06 +02:00
parent eda65bd841
commit 20c0c73a5e

View File

@ -72,3 +72,31 @@ test ('run non-global regex without result', (t) => {
});
t.is (count, 0);
});
test ('check isnil with undefined', (t) => {
t.is (util.is_nil (), true);
});
test ('check isnil with null', (t) => {
t.is (util.is_nil (null), true);
});
test ('check isnil with empty string', (t) => {
t.is (util.is_nil (''), false);
});
test ('check isnil with string', (t) => {
t.is (util.is_nil ('foo'), false);
});
test ('check isnil with 0', (t) => {
t.is (util.is_nil (0), false);
});
test ('check isnil with nan', (t) => {
t.is (util.is_nil (parseInt ('foo')), true);
});
test ('check isnil with int', (t) => {
t.is (util.is_nil (parseInt ('42')), false);
});