Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

S29-num/roots.t: update error message, avoid needless eval.

git-svn-id: http://svn.pugscode.org/pugs@20931 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 5fa47b5c97251006abbd4e92b4f40cda92aeed22 1 parent 3f9e109
pmichaud authored
Showing with 7 additions and 9 deletions.
  1. +7 −9 S29-num/roots.t
View
16 S29-num/roots.t
@@ -1,10 +1,10 @@
use v6;
use Test;
-plan 10;
+plan 8;
# L<S29/Num/"=item roots">
-#?rakudo skip 'parsefail'
+#?rakudo skip 'roots not implemented'
{
sub has_approx($n, @list) {
for @list -> $i {
@@ -17,21 +17,19 @@ plan 10;
}
#?pugs todo 'feature'
-#?rakudo skip 'parsefail'
+#?rakudo skip 'roots not implemented'
{
- my @l = eval('roots(-1, 2)');
- ok(!$!, 'roots($x, $n) compiles');
+ my @l = roots(-1, 2);
ok(@l.elems == 2, 'roots(-1, 2) returns 2 elements');
ok(has_approx(1i, @l), 'roots(-1, 2) contains 1i');
ok(has_approx(-1i, @l), 'roots(-1, 2) contains -1i');
}
#?pugs todo 'feature'
-#?rakudo skip 'parsefail'
+#?rakudo skip 'roots not implemented'
{
- my @l = eval('16.roots(4)');
- ok(!$!, '$x.roots($n) compiles');
- ok(@l.elems == 2, 'roots(16, 4) returns 4 elements');
+ my @l = 16.roots(4);
+ ok(@l.elems == 4, 'roots(16, 4) returns 4 elements');
ok(has_approx(2, @l), 'roots(16, 4) contains 2');
ok(has_approx(2i, @l), 'roots(16, 4) contains 2i');
ok(has_approx(-2, @l), 'roots(16, 4) contains -2');
Please sign in to comment.
Something went wrong with that request. Please try again.