Permalink
Browse files

niecza fudging

  • Loading branch information...
coke committed Oct 17, 2011
1 parent 000e1e4 commit 3a7da948836f84ea2c2f2070f3bd47082f219b75
@@ -13,11 +13,14 @@ my %hash5 = ( "foo" => 1, "bar" => 1, "gorch" => Mu, "baz" => Mu );
{
#?rakudo todo 'nom regression'
+ #?niecza todo
ok (%hash1 ~~ %hash2), 'Hash ~~ Hash (same keys, +)';
ok !(%hash1 ~~ %hash3), 'Hash ~~ Hash (same keys, -)';
#?pugs todo
#?rakudo todo 'nom regression'
+ #?niecza todo
ok eval_elsewhere('(%hash1 ~~ %hash2)'), "hash keys identical";
+ #?niecza skip 'System.IndexOutOfRangeException: Array index is out of range.'
ok eval_elsewhere('!(%hash1 ~~ %hash4)'), "hash keys differ";
}
View
@@ -13,18 +13,22 @@ plan 8;
my @a = ('a', 'b' );
ok(@a ~~ / 'b' /);
#?rakudo todo 'nom regression'
+#?niecza todo
ok(@a ~~ / ^ 'b' /);
ok(@a ~~ / ^ 'a' /);
#?rakudo todo 'nom regression'
+#?niecza todo
ok(@a ~~ / ^ 'a' $ /);
# Matching against a hash should be true if any of the keys match.
my %a = ('a' => 1, 'b' => 2);
ok(%a ~~ / 'b' /);
#?rakudo todo 'nom regression'
+#?niecza todo
ok(%a ~~ / ^ 'b' /);
ok(%a ~~ / ^ 'a' /);
#?rakudo todo 'nom regression'
+#?niecza todo
ok(%a ~~ / ^ 'a' $ /);
# vim: ft=perl6
@@ -34,6 +34,7 @@ plan 42;
# XXX I understand that @array[0].push(...) should autovivify an Array
# in @array[0], but is that also true for a normal scalar?
#?rakudo skip 'autoviv with push/unshift'
+#?niecza skip 'Unable to resolve method push in class Any'
{
my $arrayref;
@@ -43,6 +44,7 @@ plan 42;
}
#?rakudo skip 'autoviv with push/unshift'
+#?niecza skip 'Unable to resolve method unshift in class Any'
{
my $arrayref;
@@ -53,6 +55,7 @@ plan 42;
# Autovification by push, unshift, etc. of an array/hash element
# L<S09/Autovivification/"push, unshift, .[]">
#?rakudo skip 'autoviv with push/unshift'
+#?niecza skip 'Unable to resolve method push in class Any'
{
my @array;
@@ -61,6 +64,7 @@ plan 42;
}
#?rakudo skip 'autoviv with push/unshift'
+#?niecza skip 'Unable to resolve method push in class Any'
{
my %hash;
@@ -78,6 +82,7 @@ plan 42;
$hashref<key> = 23;
is $hashref<key>, 23, "hash element assignment worked";
+ #?niecza skip 'No value for parameter \$other in CORE Any.isa'
ok $hashref.isa !~~ Hash, "uninitialized variable was autovivified to a hash (1)";
}
@@ -16,10 +16,12 @@ diag('Test for class attribute initialization');
{
class T1 { }
class T2 { }
+ #?niecza todo
eval_lives_ok 'use MONKEY_TYPING; augment class T1 { has $.t = 1 }; 1',
"Try to initialize public attribute";
- eval_lives_ok q'
+ #?niecza todo
+ eval_lives_ok q'
use MONKEY_TYPING;
augment class T2 {
has $!t = 2;
@@ -33,19 +35,23 @@ diag('Test for class attribute initialization');
$o1 = T1.new();
$o2 = T2.new();
+ #?niecza skip 'Unable to resolve method t in class T1'
is $o1.t, 1,
"Testing value for initialized public attribute.";
dies_ok { $o2.t },
"Try to access the initialized private attribute.";
+ #?niecza todo
is try { $o2.get }, 2,
"Testing value for initialized private attribue.";
$o1 = T1.new( t => 3 );
$o2 = T2.new( t => 4 );
+ #?niecza skip 'Unable to resolve method t in class T1'
is $o1.t, 3,
"Testing value for attributes which is initialized by constructor.";
dies_ok { $o2.t },
"Try to access the private attribute which is initialized by constructor.";
+ #?niecza todo
is try { $o2.get }, 4,
"Testing value for private attribue which is initialized by constructor.";
}
View
@@ -12,6 +12,7 @@ my $t1 = $c1.new();
ok(defined($t1), 'instantiated the class');
ok($t1 ~~ $c1, 'isa check works');
#?rakudo todo 'Anonymous class stringification (?)'
+#?niecza todo
is($c1.WHAT().gist, '()', '.WHAT.gist stringifies to ()');
# Anonymous classes with methods.
@@ -63,6 +64,7 @@ is($t3.x, 42, 'anonymous classes can have attributes');
lives_ok { $i1 = rt64888() }, 'can get anonymous class instance once';
lives_ok { $i2 = rt64888() }, 'can get anonymous class instance twice';
+ #?niecza todo
is ~$i1, 'RT #64888', 'anonymous class stringified works';
is +$i1, 64888, 'anonymous class numified works';
}
View
@@ -23,9 +23,11 @@ ok($foo ~~ Foo, '... smartmatch our $foo to the Foo class');
# override the behaviour without playing with the metamodel via traits
ok($foo.isa(Foo), '.isa(Foo)');
ok($foo.isa(::Foo), '.isa(::Foo)');
+#?niecza todo
ok($foo.isa("Foo"), '.isa("Foo")');
ok(!$foo.isa("Bar"), '!.isa("Bar")');
+#?niecza skip 'Unable to resolve method clone in class Foo'
{
my $foo_clone = $foo.clone();
ok($foo_clone ~~ Foo, '... smartmatch our $foo_clone to the Foo class');
@@ -57,6 +59,7 @@ ok($bar.isa(Bar), "... .isa(Bar)");
ok($bar ~~ Foo, '... smartmatch our $bar to the Foo class');
ok($bar.isa(Foo), "new Bar .isa(Foo)");
+#?niecza skip 'Unable to resolve method clone in class Bar'
{
my $bar_clone = $bar.clone();
ok($bar_clone ~~ Bar, '... smartmatch our $bar_clone to the Bar class');
@@ -67,6 +70,7 @@ ok($bar.isa(Foo), "new Bar .isa(Foo)");
# Same, but with the "is Foo" declaration inlined
#?rakudo skip 'not parsing is inside class yet'
+#?niecza skip 'No value for parameter \$expected in Test is'
{
class Baz { is Foo }
ok(Baz ~~ Foo, '... smartmatch our Baz to the Foo class');
@@ -99,15 +103,19 @@ ok(One::Two.new, 'created One::Two after One::Two::Three');
eval_dies_ok 'class One::Two { }', 'cannot redeclare an existing class';
eval_lives_ok q[BEGIN {class Level1::Level2::Level3 {};}; class Level1::Level2 {};], 'RT 62898';
-class A61354_1 {
- eval('method x { "OH HAI" }')
-};
-dies_ok { A61354_1.x }, "can't just use eval to add method to class";
+#?niecza skip 'Methods must be used in some kind of package'
+{
+ class A61354_1 {
+ eval('method x { "OH HAI" }')
+ };
+ dies_ok { A61354_1.x }, "can't just use eval to add method to class";
+}
# RT #67784
{
class class {}
#?rakudo skip 'RT #67784'
+ #?niecza todo
isa_ok( class.new, 'class' );
}
View
@@ -10,6 +10,7 @@ is Any.gist, 'Any()', 'Any.gist has those parens';
# maybe a bit too retrictive?
is Any.perl, 'Any', 'Any.perl does not have parens';
+#?niecza skip 'Unable to resolve method name in class ClassHOW'
is Any.^name, 'Any', '.^name';
isa_ok (class A { }).new, A, 'can instantiate return value of class declaration';
@@ -13,6 +13,7 @@ plan 4;
eval_lives_ok('my $a; class Tb { has $.a }; my Tb $Tb .= new(:$a )',
'class instantiation with autopair, spaces');
#?rakudo 2 todo 'nom regression'
+ #?niecza 2 todo
eval_lives_ok('my $a; role Tc { has $.a }; my Tc $c .= new(:$a)',
'role instantiation with autopair, no spaces');
eval_lives_ok('my $a; role Td { has $.a }; my Td $c .= new(:$a )',
View
@@ -42,6 +42,7 @@ use Test;
sub OK { 'sub OK' };
is OK, 'OK', 'enum key wins in case of conflict';
is +OK, 0, 'enum key wins in case of conflict (numeric)';
+ #?niecza skip 'No value for parameter $key in CORE CommonEnum.postcircumfix:<( )>'
is OK(), 'sub OK', 'but () is still a function call';
is FAIL, 'FAIL', 'non-conflicting enum key';
is +FAIL, 1, 'non-conflicting enum key (numeric)';
View
@@ -40,7 +40,9 @@ is $a, 8, 'but the temp assignment had worked';
lives_ok { temp $o.l2 = 9; $b = $o.b },
'can use lvalue method in temp() statement (explicit return)';
is $o.l2, 4, '... and the value was reset';
+#?niecza todo
is $o.b, 3, '... also on the attribute';
+#?niecza todo
is $a, 9, 'but the temp assignment had worked';
# vim: ft=perl6
@@ -9,6 +9,7 @@ plan 5;
#
# L<S28/Perl5 to Perl6 special variable translation/"@*INC">
+#?niecza todo
ok(+@*INC > 0, 'we have something in our @INC');
my $number_in_inc = +@*INC;
View
@@ -36,6 +36,7 @@ dies_ok {eval 'use Poison; 1'}, "eval dies on fatal use";
dies_ok({eval {; 42} }, 'block eval is gone');
# RT #63978, eval didn't work in methods
+#?niecza skip 'System.IndexOutOfRangeException: Array index is out of range'
{
class EvalTester1 {
method e($s) { eval $s };
@@ -44,6 +45,7 @@ dies_ok({eval {; 42} }, 'block eval is gone');
is EvalTester1.new.e('5'), 5, 'eval works inside instance methods';
}
+#?niecza skip 'System.IndexOutOfRangeException: Array index is out of range'
{
my $x = 5;
class EvalTester2 {
@@ -56,8 +58,10 @@ dies_ok({eval {; 42} }, 'block eval is gone');
}
#?rakudo skip 'eval(Buf)'
+#?niecza skip 'Unable to resolve method encode in class Str'
is eval("'møp'".encode('UTF-8')), 'møp', 'eval(Buf)';
+#?niecza skip 'Excess arguments to CORE eval, used 1 of 3 positionals'
{
#?rakudo skip 'eval coerce to string'
is eval 88, 88, 'eval of non-string works';
View
@@ -19,6 +19,7 @@ sub gen_hash {
is %h1.delete('b'), $b, "Test for delete single key.";
}
+#?niecza todo
{
my %h1 = gen_hash;
my @cde = %h1<c d e>;
@@ -32,6 +33,8 @@ is +%hash, 4, "basic sanity (2)";
is ~(%hash.delete('a')), "1",
"deletion of a hash element returned the right value";
is +%hash, 3, "deletion of a hash element";
+
+#?niecza skip 'Excess arguments to CORE Hash.delete, used 2 of 3 positionals'
{
is ~(%hash.delete("c", "d")), "3 4",
"deletion of hash elements returned the right values";
View
@@ -7,7 +7,9 @@ plan 5;
{
my %h = a => 'b', c => 'd';
+ #?niecza todo
isa_ok %h.invert, List, 'Hash.invert returns a List';
+ #?niecza skip 'Cannot use value like Pair as a number'
is_deeply %h.invert.sort, (b => 'a', d => 'c'), 'simple Hash.invert works';
is_deeply %h, { a => 'b', c => 'd' }, 'original remains unchanged';
}
@@ -16,6 +18,7 @@ plan 5;
# with lists
my %h = a => <b c>, d => 'e';
#?rakudo todo 'nom regression'
+ #?niecza skip 'Cannot use value like Pair as a number'
is_deeply %h.invert.sort, (b => 'a', c => 'a', e => 'd'),
'Hash.invert flattens list values';
is_deeply %h, {a => <b c>, d => 'e'}, 'original remains unchanged';
View
@@ -24,11 +24,15 @@ is(+%hash.values, +%hash, 'we have the same number of keys as elements in the ha
# keys and values on Pairs
my $pair = (a => 42);
+#?niecza todo
is(~$pair.keys, "a", '$pair.keys works');
+#?niecza todo
is(~keys($pair), "a", 'keys($pair) works');
is($pair.keys.elems, 1, 'we have one key');
+#?niecza todo
is(~$pair.values, 42, '$pair.values works');
+#?niecza todo
is(~values($pair), 42, 'values($pair) works');
is($pair.values.elems, 1, 'we have one value');
View
@@ -16,6 +16,7 @@ Basic C<pairs> tests, see S32::Containers.
my %hash = (a => 1, b => 2, c => 3);
my @pairs;
ok((@pairs = %hash.pairs), "pairs on hashes");
+ #?niecza skip 'Cannot use value like Pair as a number'
ok((@pairs = @pairs.sort), 'Can sort list of pairs');
is +@pairs, 3, "pairs on hashes returned the correct number of elems";
if +@pairs != 3 {
@@ -45,6 +46,7 @@ Basic C<pairs> tests, see S32::Containers.
}
# This next group added by Darren Duncan following discovery while debugging ext/Locale-KeyedText:
+#?niecza skip 'Cannot use value like Pair as a number'
{
my $hash_of_2_pairs = {'a'=>'b','c'=>'d'};
my $hash_of_1_pair = {'a'=>'b'};
View
@@ -30,6 +30,7 @@ plan 29;
is(%hash{@slice[0,1]}, (4,6), "slice from array slice, part 2");
}
+#?niecza skip 'Excess arguments to CORE List.new, used 1 of 3 positionals'
{ my %hash;
%hash{(1,2)} = "one", "two";
@@ -47,6 +48,7 @@ plan 29;
#?pugs todo 'feature'
#?rakudo skip 'binding on hash elements unimplemented'
+#?niecza skip 'Writing to readonly scalar'
{
my %hash = :a(1), :b(2), :c(3), :d(4);
my @slice := %hash<b c>;
@@ -77,6 +79,7 @@ Quoting Larry:
try { %hash<a b> := <FOO BAR> };
#?pugs 2 todo 'bug'
+ #?niecza 2 todo
is %hash<a>, "FOO", "binding hash slices works (1-1)";
is %hash<b>, "BAR", "binding hash slices works (1-2)";
}
@@ -86,6 +89,7 @@ Quoting Larry:
try { %hash<a b> := <FOO> };
#?pugs 2 todo 'bug'
+ #?niecza 2 todo
is %hash<a>, "FOO", "binding hash slices works (2-1)";
ok !defined(%hash<b>), "binding hash slices works (2-2)";
}
@@ -97,11 +101,13 @@ Quoting Larry:
try { %hash<a b> := ($foo, $bar) };
#?pugs 2 todo 'bug'
+ #?niecza 2 todo
is %hash<a>, "FOO", "binding hash slices works (3-1)";
is %hash<b>, "BAR", "binding hash slices works (3-2)";
$foo = "BB";
$bar = "CC";
+ #?niecza 2 todo
#?pugs 2 todo 'bug'
is %hash<a>, "BB", "binding hash slices works (3-3)";
is %hash<b>, "CC", "binding hash slices works (3-4)";
@@ -111,6 +117,7 @@ Quoting Larry:
is %hash<a>, "BBB", "binding hash slices works (3-5)";
is %hash<b>, "CCC", "binding hash slices works (3-6)";
#?pugs 2 todo 'bug'
+ #?niecza 2 todo
is $foo, "BBB", "binding hash slices works (3-7)";
is $bar, "CCC", "binding hash slices works (3-8)";
}
View
@@ -27,6 +27,7 @@ my @list = (1 ... 10);
}
#?rakudo skip "adverbial block"
+#?niecza skip 'No value for parameter Mu $filter in CORE Any.first'
{
my $result = @list.first():{ ($^a == 4) };
ok($result ~~ Int, "first():<block> returns an Int");
Oops, something went wrong.

0 comments on commit 3a7da94

Please sign in to comment.