Skip to content

Commit

Permalink
[t/spec] rakudo skip markers
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@19595 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
particle committed Jan 19, 2008
1 parent 592efef commit 0e169bd
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 15 deletions.
4 changes: 4 additions & 0 deletions S04-statements/until.t
Expand Up @@ -5,25 +5,29 @@ plan 4;

# L<S04/The C<while> and C<until> statements/while statements
# work as in 5>
#?rakudo: skip "can't parse"
{
my $i = 0;
until $i >= 5 { $i++; };
is($i, 5, 'until $i >= 5 {} works');
}

#?rakudo: skip "can't parse"
{
my $i = 0;
until 5 <= $i { $i++; };
is($i, 5, 'until 5 <= $i {} works');
}

# with parens
#?rakudo: skip "can't parse"
{
my $i = 0;
until ($i >= 5) { $i++; };
is($i, 5, 'until ($i >= 5) {} works');
}

#?rakudo: skip "can't parse"
{
my $i = 0;
until (5 <= $i) { $i++; };
Expand Down
10 changes: 8 additions & 2 deletions S04-statements/while.t
Expand Up @@ -4,41 +4,47 @@ use Test;

plan 10;

#?rakudo: skip "can't parse"
{
my $i = 0;
while $i < 5 { $i++; };
is($i, 5, 'while $i < 5 {} works');
}
#?rakudo: skip "can't parse"
{
my $i = 0;
while 5 > $i { $i++; };
is($i, 5, 'while 5 > $i {} works');
}
# with parens
#?rakudo: skip "can't parse"
{
my $i = 0;
while ($i < 5) { $i++; };
is($i, 5, 'while ($i < 5) {} works');
}
#?rakudo: skip "can't parse"
{
my $i = 0;
while (5 > $i) { $i++; };
is($i, 5, 'while (5 > $i) {} works');
}

# single value
#?rakudo: skip "can't parse"
{
my $j = 0;
while 0 { $j++; };
is($j, 0, 'while 0 {...} works');
}
#?rakudo: skip "can't parse"
{
my $k = 0;
while $k { $k++; };
is($k, 0, 'while $var {...} works');
}

#?rakudo: eval 'No pointy blocks on while loops yet'
#?rakudo: skip 'No pointy blocks on while loops yet'
# L<S04/The C<for> statement/It is also possible to write>
# while ... -> $x {...}
{
Expand All @@ -51,7 +57,7 @@ plan 10;
is $str, '54321', 'while ... -> $x {...} worked (1)';
}

#?rakudo: eval 'No pointy blocks on while loops yet'
#?rakudo: skip 'No pointy blocks on while loops yet'
{
my @array = 0..5;
my $str;
Expand Down
8 changes: 6 additions & 2 deletions S29-str/capitalize.t
Expand Up @@ -20,8 +20,12 @@ is $a, "puGS Is cOOl!", "original string not touched";
is "ab cD Ef".capitalize, "Ab Cd Ef", "works on ordinary string";


$_ = "puGS Is cOOl!";
is .capitalize, "Pugs Is Cool!", 'capitalize() uses \$_ as default';
#?rakudo: skip "can't parse"
{
$_ = "puGS Is cOOl!";
is .capitalize, "Pugs Is Cool!", 'capitalize() uses \$_ as default';
}

# Non-ASCII chars:
#?rakudo: skip "unicode"
is capitalize("äöü abcä"), "Äöü Abcä", "capitalize() works on non-ASCII chars";
14 changes: 9 additions & 5 deletions S29-str/chomp.t
Expand Up @@ -4,11 +4,11 @@ use Test;

plan 35;

=pod
=begin pod
Basic tests for the chomp() builtin
=cut
=end pod

# L<S29/"Str"/=item chomp>

Expand Down Expand Up @@ -73,7 +73,7 @@ Basic tests for the chomp() builtin
my $chomped = $foo.chomp;
is($foo, "foo\n\n", ".chomp has no effect on the original string");
is($chomped, "foo\n", ".chomp returns correctly chomped value");

# $chomped.chomp.newline

$chomped = $chomped.chomp;
Expand Down Expand Up @@ -116,11 +116,14 @@ Basic tests for the chomp() builtin
is_deeply(@szundi, @foo, "chomp array with 2 elements with duplicate newlines");
}

=pod
#?rakudo: skip "trouble with pod"
{
=begin pod
Basic tests for the chomp() builtin working on an array of strings
=cut
=end pod
}

# L<S29/Str/=item chomp>

Expand All @@ -132,6 +135,7 @@ Basic tests for the chomp() builtin working on an array of strings
# assuming the correct behaviour is an extension of the behaviour for
# a single string.

#?rakudo: skip "can't parse"
{
my @foo = ("foo\n","bar\n","baz\n");
chomp(@foo);
Expand Down
3 changes: 3 additions & 0 deletions S29-str/chop.t
Expand Up @@ -23,6 +23,8 @@ is($str, "foo", "original string unchanged");
XXX: chop(@array) should return an array of chopped strings?
XXX: chop(%has) should return a hash of chopped strings?
=end more-discussion-needed

{ # chop serveral things
my ($a, $b) = ("bar", "gorch");
#?pugs: 2 todo ''
Expand All @@ -43,6 +45,7 @@ XXX: chop(%has) should return a hash of chopped strings?
my %hash = ( "key", "value", "other", "blah");

#?pugs: 2 todo ''
#?rakudo: 2 skip "can't parse"
# FIXME: is(chop(%hash), "h"|"e", "chopping hash returns last char of either value");
is(%hash<key>, "valu", "first value chopped");
is(%hash<other>, "bla", "second value chopped");
Expand Down
1 change: 1 addition & 0 deletions S29-str/comb.t
Expand Up @@ -3,6 +3,7 @@ use v6-alpha;
use Test;

plan 10;
#?rakudo: 10 skip "can't parse"

# L<S29/Str/=item comb>

Expand Down
1 change: 1 addition & 0 deletions S29-str/index.t
Expand Up @@ -39,6 +39,7 @@ is(index("Hello", "", 999), 5, "Substr is empty, pos > length of str");

is(index("ababcabcd", "abcd"), 5, "Start-of-substr matches several times");

#?rakudo: 2 skip 'unicode'
is(index("uuúuúuùù", "úuù"), 4, "Accented chars");
is(index("Ümlaut", "Ü"), 0, "Umlaut");

Expand Down
11 changes: 8 additions & 3 deletions S29-str/lc.t
Expand Up @@ -9,19 +9,24 @@ plan 11;
is(lc("hello world"), "hello world", "lowercasing string which is already lowercase");
is(lc("Hello World"), "hello world", "simple lc test");
is(lc(""), "", "empty string");
#?rakudo: 3 skip 'unicode'
is(lc("ÅÄÖ"), "åäö", "some finnish non-ascii chars");
is(lc("ÄÖÜ"), "äöü", "lc of German Umlauts");
is(lc("ÓÒÚÙ"), "óòúù", "accented chars");
is(lc('A'..'C'), "a b c", "lowercasing char-range");

$_ = "Hello World";
my $x = .lc;
is($x, "hello world", 'lc uses $_ as default');
#?rakudo: skip "can't parse"
{
$_ = "Hello World";
my $x = .lc;
is($x, "hello world", 'lc uses $_ as default');
}

{ # test invocant syntax for lc
my $x = "Hello World";
is($x.lc, "hello world", '$x.lc works');
is("Hello World".lc, "hello world", '"Hello World".lc works');
}

#?rakudo: skip 'unicode'
is("ÁÉÍÖÜÓŰŐÚ".lc, "áéíöüóűőú", ".lc on Hungarian vowels");
10 changes: 7 additions & 3 deletions S29-str/lcfirst.t
Expand Up @@ -8,6 +8,7 @@ plan 8;

is lcfirst("HELLO WORLD"), "hELLO WORLD", "simple";
is lcfirst(""), "", "empty string";
#?rakudo: 2 skip 'unicode'
is lcfirst("ÜÜÜÜ"), "üÜÜÜ", "umlaut";
is lcfirst("ÓÓÓÓŃ"), "óÓÓÓŃ", "accented chars";

Expand All @@ -17,8 +18,11 @@ my $str = "Some String";
is $str.lcfirst, "some String", "simple.lcfirst on scalar variable";
is "Other String".lcfirst, "other String", ".lcfirst on literal string";

$_ = "HELLO WORLD";
my $x = .lcfirst;
is $x, "hELLO WORLD", 'lcfirst uses $_ as default'
#?rakudo: skip "can't parse"
{
$_ = "HELLO WORLD";
my $x = .lcfirst;
is $x, "hELLO WORLD", 'lcfirst uses $_ as default'
}


0 comments on commit 0e169bd

Please sign in to comment.