Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fudge and simplify some test files for Niecza
  • Loading branch information
moritz committed Mar 4, 2011
1 parent 31f7481 commit 324876d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
10 changes: 7 additions & 3 deletions S02-literals/string-interpolation.t
Expand Up @@ -27,20 +27,24 @@ plan 10;

# RT #76234
#?rakudo todo "RT 76234, Nil stringy interpolation"
#?niecza skip 'Nil stringification'
is "{}", '', 'Interpolating an empty block is cool';
}

my $rt65538_in = qq[line { (1,2,3).min }
#?niecza skip 'Parcel.max'
{
my $rt65538_in = qq[line { (1,2,3).min }
line 2
line { (1,2,3).max } etc
line 4
];
my $rt65538_out = qq[line 1
my $rt65538_out = qq[line 1
line 2
line 3 etc
line 4
];
is $rt65538_in, $rt65538_out, 'interpolation does not trim newlines';
is $rt65538_in, $rt65538_out, 'interpolation does not trim newlines';
}

done;

Expand Down
2 changes: 2 additions & 0 deletions S06-signature/passing-arrays.t
Expand Up @@ -31,9 +31,11 @@ plan 11;
sub pa(@a) { @a.WHAT; }
my @b = 2, 3;
isa_ok pa(@b), Array, 'basic array type sanity';
#?niecza skip 'sigil-implied type constraint (?)'
dies_ok { pa(3) }, 'non-slurpy array does not take a single Int';

sub ph(%h) { 1 } #OK not used
#?niecza skip 'sigil-implied type constraint (?)'
dies_ok { ph(3) }, 'an Int is not a Hash';
}

Expand Down
4 changes: 2 additions & 2 deletions S06-signature/positional.t
Expand Up @@ -20,7 +20,7 @@ is my_third( 4, 5, 6), 6, '($, $, $x) works as a signature';
return @out;
}

is rt60408_for(42), (42, 42), 'use of @_[0] in a "for" block (RT 60408)';
is rt60408_for(42), '42 42', 'use of @_[0] in a "for" block (RT 60408)';

sub rt60408_if {
my @out;
Expand All @@ -29,7 +29,7 @@ is my_third( 4, 5, 6), 6, '($, $, $x) works as a signature';
return @out;
}

is rt60408_if(42), (42, 42), 'use of @_[0] in an "if" block (RT 60408)';
is rt60408_if(42), '42 42', 'use of @_[0] in an "if" block (RT 60408)';
}

{
Expand Down
1 change: 1 addition & 0 deletions S06-signature/slurpy-and-interpolation.t
Expand Up @@ -35,6 +35,7 @@ dies_ok {
sub f2(*%h) { f1(|%h) };
lives_ok { f2( :a(1) ) },
'Can interpolate hashes into slurpy named parameters';
#?niecza skip 'eval return value'
is eval(f2(:a(4))).<a>, 4, '... with a sane return value';
}

Expand Down
1 change: 1 addition & 0 deletions S12-class/extending-arrays.t
Expand Up @@ -49,6 +49,7 @@ my $pair = :key<value>;

is $pair.value, 'value', "method on a named pair";

#?niecza skip 'Parcel.Numeric'
{
augment class Parcel {
method twice {
Expand Down
3 changes: 3 additions & 0 deletions S32-str/lc.t
Expand Up @@ -8,13 +8,16 @@ plan 13;

is(lc("hello world"), "hello world", "lowercasing string which is already lowercase");
is(lc("Hello World"), "hello world", "simple lc test");
#?niecza skip 'passing positional by name'
is(lc(:string("STATION")), "station", "lc works with named argument");
is(lc(""), "", "empty string");
is(lc("ÅÄÖ"), "åäö", "some finnish non-ascii chars");
is(lc("ÄÖÜ"), "äöü", "lc of German Umlauts");
is(lc("ÓÒÚÙ"), "óòúù", "accented chars");
#?niecza skip 'Range stringification'
is(lc('A'..'C'), "a b c", "lowercasing char-range");

#?niecza skip 'RO error'
{
$_ = "Hello World";
my $x = .lc;
Expand Down
4 changes: 4 additions & 0 deletions S32-str/uc.t
Expand Up @@ -7,6 +7,7 @@ plan 20;
# L<S32::Str/"Str"/=item uc>

is(uc("Hello World"), "HELLO WORLD", "simple");
#?niecza skip 'passing positional by name'
is(uc(:string("station")), "STATION", "uc with named argument");
is(uc(""), "", "empty string");
{
Expand All @@ -16,6 +17,7 @@ is(uc(""), "", "empty string");
}
is(uc(lc('HELL..')), 'HELL..', "uc/lc test");

#?niecza skip 'assigning to RO-value (?)'
{
$_ = "Hello World";
my $x = .uc;
Expand All @@ -37,6 +39,7 @@ is(uc(lc('HELL..')), 'HELL..', "uc/lc test");
# Unicode 5.1.0 SpecialCasing.txt has 00DF -> 0053 0053
# nothing maps to 1E9E, the new "capital sharp s"
# so I think this is right -rhr
#?niecza skip 'German language weirdness'
is(uc("ß"), "SS", "uc() of non-ascii chars may result in two chars");

{
Expand All @@ -49,6 +52,7 @@ is ~(0.lc), ~0, '.lc on Int';
is ~(0.lcfirst), ~0, '.lcfirst on Int';

#?DOES 4
#?niecza skip 'but RoleName'
{
role A {
has $.thing = 3;
Expand Down

0 comments on commit 324876d

Please sign in to comment.