Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[t] move spaceship.t to spec/, minor corrections and fudging for rakudo

git-svn-id: http://svn.pugscode.org/pugs@26906 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit e2bd546c8ebf0355f3386c05a1f02844ec64d19d 1 parent b8f0956
moritz authored
Showing with 34 additions and 0 deletions.
  1. +34 −0 S03-operators/spaceship.t
View
34 S03-operators/spaceship.t
@@ -0,0 +1,34 @@
+use v6;
+
+use Test;
+
+=begin kwid
+
+The spaceship operator parses incorrectly in multiple ways
+
+=end kwid
+
+plan 5;
+
+my %ball = map {; $_ => 1 }, 1..12;
+is(
+ (%ball{12}) <=> (%ball{11}),
+ 0,
+ 'parens with spaceship parse incorrectly',
+);
+
+my $result_1 = ([+] %ball{10..12}) <=> ([+] %ball{1..3});
+
+is($result_1, 0, 'When spaceship terms are non-trivial members it parses incorrectly');
+my $result_2 = ([+] %ball{11,12}) <=> ([+] %ball{1,2});
+is($result_2, 0, 'When spaceship terms are non-trivial members it parses incorrectly');
+#?rakudo skip 'unspecced: does infix:«<=>» numify its arguments?'
+{
+my $result_3 = ([0] <=> [0,1]);
+is($result_3, -1, 'When spaceship terms are non-trivial members it parses incorrectly');
+}
+
+%ball{12} = 0.5;
+is(%ball{12} <=> %ball{11}, -1, 'When spaceship terms are non-integral numbers it parses incorrectly');
+
+# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.