Permalink
Browse files

[t/spec] Added equality tests and unfudged !== tests

git-svn-id: http://svn.pugscode.org/pugs@30119 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent c5f4109 commit 884261ecf60a7aafc51dbac85d47ed990481ea8f unobe committed Mar 17, 2010
Showing with 7 additions and 4 deletions.
  1. +7 −3 S03-operators/equality.t
  2. +0 −1 S03-operators/not-metaop.t
View
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 20;
+plan 23;
# adapted from t/operators/eq.t and t/operators/cond.t
# relational ops are in relational.t
@@ -43,8 +43,12 @@ ok(!(2 != 2), "!= false");
#L<S03/Negated relational operators>
ok(2 !== 3, "!== true");
ok(!(2 !== 2), "!== false");
-ok($foo !eq "f", "!eq true");
-ok(!($foo !eq ""), "!eq false");
+ok($foo !eq "f", "!eq true undef");
+ok("" !eq "f", "!eq true empty string");
+ok(!($foo !eq ""), "!eq false undef and empty string");
+ok(!($foo !eq $foo), "!eq false undef twice");
+ok(!("" !eq ""), "!eq false empty string twice");
+ok(!("xc" !eq "xc"), "!eq false non-empty string twice");
# numeric context on undefined values
#?rakudo skip "+Any doesn't work yet"
@@ -19,7 +19,6 @@ is 4 !<= 5, !(4 <= 5), "4 !<= 5";
isa_ok 4 !<= 5, Bool, "4 !<= 5 is Bool";
is 4 !>= 5, !(4 >= 5), "4 !>= 5";
isa_ok 4 !>= 5, Bool, "4 !>= 5 is Bool";
-#?rakudo 2 skip "!== is parsed as != ="
is 4 !== 5, !(4 == 5), "4 !== 5";
isa_ok 4 !== 5, Bool, "4 !== 5 is Bool";

0 comments on commit 884261e

Please sign in to comment.