Permalink
Browse files

[t/spec] various small improvements.

Also deleted S29-hash/isa.t, which is pretty pointless and 50% wrong


git-svn-id: http://svn.pugscode.org/pugs@24362 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent c2f8fec commit 061d002f76df9cbcff4228379226a2ea6e4780e1 moritz committed Dec 14, 2008
Showing with 13 additions and 23 deletions.
  1. +1 −0 S04-statements/for.t
  2. +1 −1 S06-signature/passing-hashes.t
  3. +2 −1 S12-attributes/class2.t
  4. +6 −2 S16-unfiled/slurp.t
  5. +0 −18 S29-hash/isa.t
  6. +2 −0 S29-list/uniq.t
  7. +1 −1 S29-str/length.t
@@ -349,3 +349,4 @@ my @elems = <a b c d e>;
is $output, "1,2,3,4,", "grep and sort work in for";
}
+# vim: ft=perl6
@@ -19,6 +19,6 @@ is(%h.WHAT,'Hash','%h is a Hash');
#sanity 1;
sanity;
-#XXX Hash passed to a sub used to become a List in pugs
+# Hash passed to a sub used to become a List in pugs
insanity %h;
@@ -19,7 +19,7 @@ class Foo {
}
my $test = 0;
-ok $test = Foo.bar, 'accessors for class attributes work';
+ok ($test = Foo.bar), 'accessors for class attributes work';
is $test, 23, 'class attributes really work';
class Baz is Foo {};
@@ -41,6 +41,7 @@ lives_ok { $test4 = Quux.new() },
is $test4.bar, 17, 'Instance call gets instance attribute, not class attribute';
my $test5 = 0;
lives_ok {$test5 = Quux.bar}, 'class attribute still accessible via class name';
+#?rakudo 5 todo 'class attributes'
is $test5, 23, 'class attribute really works, even when overridden';
my $test6 = 0;
lives_ok { $test6 = Quux.^bar}, 'class attribute accessible via ^name';
View
@@ -11,7 +11,6 @@ plan 9;
# in the file
my $self = 't/spec/S16-unfiled/slurp.t';
-#?rakudo 1 skip "no index() function"
{
my $contents = slurp $self;
#ok index($contents, "StringThatsNowhereElse") != -1, "slurp() worked";
@@ -28,9 +27,12 @@ my $self = 't/spec/S16-unfiled/slurp.t';
# slurp in list context
{
- my @slurped_lines = lines($self);
+ my @slurped_lines = lines(open($self));
ok +@slurped_lines > 30, "more than 30 lines in this file ?";
+}
+#?rakudo skip 'infix:<orelse>'
+{
my $fh = open $self orelse die;
my @expected_lines = =$fh;
$fh.close;
@@ -57,3 +59,5 @@ my $self = 't/spec/S16-unfiled/slurp.t';
my @var_dot_lines = $filename.slurp;
is +@var_dot_lines, +@expected_lines, "same number of lines read";
}
+
+# vim: ft=perl6
View
@@ -1,18 +0,0 @@
-use v6;
-use Test;
-plan 2;
-
-# L<S29/"Hash">
-# there's probably a better smart link
-
-=begin pod
-
-Isa tests
-
-=end pod
-
-{
- my %hash = <1 2 3 4>;
- isa_ok(%hash, Hash);
- isa_ok(%hash, List);
-}
View
@@ -13,6 +13,8 @@ L<"http://groups.google.com/groups?selm=420DB295.3000902%40conway.org">
See the thread "[S29] uniq" on p6l, too.
+Not (yet?) in the spec, but implemented by (nearly?) all implementations.
+
=end description
{
View
@@ -27,7 +27,7 @@ eval_dies_ok('"moose".length', 'Str.length properly not implemented');
is("".bytes, 0, "empty string");
is("moose".bytes, 5, "moose");
my $x = undef;
-ok(!(try { $x.bytes }), "undef.bytes fail()s");
+dies_ok { $x.bytes }, "undef.bytes fail()s";
# See thread "undef.chars" on p6l started by Ingo Blechschmidt:
# L<"http://www.nntp.perl.org/group/perl.perl6.language/22595">

0 comments on commit 061d002

Please sign in to comment.