Permalink
Browse files

[t] move tests for spaceship operator to spec/

git-svn-id: http://svn.pugscode.org/pugs@22120 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent aa3b73a commit 21f2f52912b05580d667152e043882f1381d7d73 moritz committed Sep 2, 2008
Showing with 16 additions and 0 deletions.
  1. +16 −0 S03-operators/spaceship-and-containers.t
@@ -0,0 +1,16 @@
+use v6;
+
+use Test;
+
+plan 6;
+#L<S03/Comparison semantics/The <=> operator>
+
+my %h = ("a" => 1, "b" => 2);
+ok(%h{"a"} < %h{"b"}, 'comparing hash values');
+ok(%h{"a"} <= %h{"b"}, 'comparing hash values');
+is(%h{"a"} <=> %h{"b"}, -1, 'comparing hash values');
+
+my @a = (1, 2);
+ok(@a[0] < @a[1], 'comparing array values');
+ok(@a[0] <= @a[1], 'comparing array values');
+is(@a[0] <=> @a[1], -1, 'comparing array values');

0 comments on commit 21f2f52

Please sign in to comment.