Skip to content

Commit f403cf5

Browse files
committed
[CaR Grant] Remove all fudges / fix plans
1 parent fd20de7 commit f403cf5

File tree

1 file changed

+110
-131
lines changed

1 file changed

+110
-131
lines changed

S04-declarations/constant-6.d.t

Lines changed: 110 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ subtest 'our | typed | $-sigilled' => {
315315
##
316316

317317
subtest 'implied | implied | @-sigilled' => {
318-
plan 12;
318+
plan 13;
319319
constant @iias1 = 42;
320320
is-deeply @iias1, (42,), 'def, simple value';
321321
constant @iias2 = 1, 2, 3;
@@ -352,19 +352,17 @@ subtest 'implied | implied | @-sigilled' => {
352352
constant @iias8 = Foo.new;
353353
, X::TypeCheck, 'typecheck fails if .cache does not return Positional';
354354

355-
# TODO XXX
356-
skip 'fails compilation';
357-
# EVAL 「
358-
# my class Bar does Positional {
359-
# method cache { flunk 'called .cache on an already-Positional' }
360-
# }
361-
# constant @iias9 = Bar.new;
362-
# isa-ok @iias9, Bar, 'no coercion of custom Positionals';
363-
# 」;
355+
EVAL
356+
my class Bar does Positional {
357+
method cache { flunk 'called .cache on an already-Positional' }
358+
}
359+
constant @iias9 = Bar.new;
360+
isa-ok @iias9, Bar, 'no coercion of custom Positionals';
361+
;
364362
}
365363

366364
subtest 'my | implied | @-sigilled' => {
367-
plan 12;
365+
plan 13;
368366
my constant @mias1 = 42;
369367
is-deeply @mias1, (42,), 'def, simple value';
370368
my constant @mias2 = 1, 2, 3;
@@ -401,19 +399,17 @@ subtest 'my | implied | @-sigilled' => {
401399
my constant @mias8 = Foo.new;
402400
, X::TypeCheck, 'typecheck fails if .cache does not return Positional';
403401

404-
# TODO XXX
405-
skip 'fails compilation';
406-
# EVAL 「
407-
# my class Bar does Positional {
408-
# method cache { flunk 'called .cache on an already-Positional' }
409-
# }
410-
# my constant @mias9 = Bar.new;
411-
# isa-ok @mias9, Bar, 'no coercion of custom Positionals';
412-
# 」;
402+
EVAL
403+
my class Bar does Positional {
404+
method cache { flunk 'called .cache on an already-Positional' }
405+
}
406+
my constant @mias9 = Bar.new;
407+
isa-ok @mias9, Bar, 'no coercion of custom Positionals';
408+
;
413409
}
414410

415411
subtest 'our | implied | @-sigilled' => {
416-
plan 12;
412+
plan 13;
417413
our constant @oias1 = 42;
418414
is-deeply @oias1, (42,), 'def, simple value';
419415
our constant @oias2 = 1, 2, 3;
@@ -450,15 +446,13 @@ subtest 'our | implied | @-sigilled' => {
450446
our constant @oias8 = Foo.new;
451447
, X::TypeCheck, 'typecheck fails if .cache does not return Positional';
452448

453-
# TODO XXX
454-
skip 'fails compilation';
455-
# EVAL 「
456-
# my class Bar does Positional {
457-
# method cache { flunk 'called .cache on an already-Positional' }
458-
# }
459-
# our constant @oias9 = Bar.new;
460-
# isa-ok @oias9, Bar, 'no coercion of custom Positionals';
461-
# 」;
449+
EVAL
450+
my class Bar does Positional {
451+
method cache { flunk 'called .cache on an already-Positional' }
452+
}
453+
our constant @oias9 = Bar.new;
454+
isa-ok @oias9, Bar, 'no coercion of custom Positionals';
455+
;
462456
}
463457

464458
subtest 'my | typed | @-sigilled' => {
@@ -490,19 +484,18 @@ subtest 'our | typed | @-sigilled' => {
490484
##
491485

492486
subtest 'implied | implied | %-sigilled' => {
493-
plan 14;
487+
plan 16;
494488
throws-like constant %iihs0 = 42, X::Hash::Store::OddNumber,
495489
'def, simple value';
496-
# XXX TODO
497-
skip 'compilation fails ATM', 3;
498-
# constant %iihs1 = 1, 2, 3, 4;
499-
# is-deeply %iihs1, Map.new((1 => 2, 3 => 4)), 'def, List of values';
500-
# constant %iihs2 = :42foo, :70bar;
501-
# is-deeply %iihs2, Map.new((:42foo, :70bar)),
502-
# 'def, List of Pairs (no parens)';
503-
# constant %iihs3 = (:42foo, :70bar);
504-
# is-deeply %iihs3, Map.new((:42foo, :70bar)),
505-
# 'def, List of Pairs (with parens)';
490+
491+
constant %iihs1 = 1, 2, 3, 4;
492+
is-deeply %iihs1, Map.new((1 => 2, 3 => 4)), 'def, List of values';
493+
constant %iihs2 = :42foo, :70bar;
494+
is-deeply %iihs2, Map.new((:42foo, :70bar)),
495+
'def, List of Pairs (no parens)';
496+
constant %iihs3 = (:42foo, :70bar);
497+
is-deeply %iihs3, Map.new((:42foo, :70bar)),
498+
'def, List of Pairs (with parens)';
506499
constant %iihs4 = Map.new: (:42foo, :70bar);
507500
is-deeply %iihs4, Map.new((:42foo, :70bar)), 'def, Map';
508501
for %iihs4 { isa-ok $_, Pair, 'does not scalarize'; last }
@@ -522,50 +515,45 @@ subtest 'implied | implied | %-sigilled' => {
522515
}
523516
ok ::('%iihs9'), 'implied scope declarator behaves like `our`';
524517

525-
# XXX TODO
526-
skip 'compilation fails ATM', 1;
527-
# EVAL 「
528-
# my class Foo {
529-
# method Map {
530-
# pass 'coercion calls .Map method';
531-
# Map.new: (:42foo, :70bar)
532-
# }
533-
# }
534-
# constant %iihs10 = Foo.new;
535-
# is-deeply %iihs10, Map.new((:42foo, :70bar)),
536-
# 'right result after coersion';
537-
# 」;
518+
EVAL
519+
my class Foo {
520+
method Map {
521+
pass 'coercion calls .Map method';
522+
Map.new: (:42foo, :70bar)
523+
}
524+
}
525+
constant %iihs10 = Foo.new;
526+
is-deeply %iihs10, Map.new((:42foo, :70bar)),
527+
'right result after coersion';
528+
;
538529

539530
throws-like
540531
my class Foo { method Map { 42 } }
541532
constant %iihs11 = Foo.new;
542533
, X::TypeCheck, 'typecheck fails if .Map does not return Associative';
543534

544-
# TODO XXX
545-
skip 'fails compilation';
546-
# EVAL 「
547-
# my class Bar does Associative {
548-
# method Map { flunk 'called .Map on an already-Associative' }
549-
# }
550-
# constant %iihs12 = Bar.new;
551-
# isa-ok %iihs12, Bar, 'no coercion of custom Associative';
552-
# 」;
535+
EVAL
536+
my class Bar does Associative {
537+
method Map { flunk 'called .Map on an already-Associative' }
538+
}
539+
constant %iihs12 = Bar.new;
540+
isa-ok %iihs12, Bar, 'no coercion of custom Associative';
541+
;
553542
}
554543

555544
subtest 'my | implied | %-sigilled' => {
556-
plan 14;
545+
plan 16;
557546
throws-like my constant %mihs0 = 42, X::Hash::Store::OddNumber,
558547
'def, simple value';
559-
# XXX TODO
560-
skip 'compilation fails ATM', 3;
561-
# my constant %mihs1 = 1, 2, 3, 4;
562-
# is-deeply %mihs1, Map.new((1 => 2, 3 => 4)), 'def, List of values';
563-
# my constant %mihs2 = :42foo, :70bar;
564-
# is-deeply %mihs2, Map.new((:42foo, :70bar)),
565-
# 'def, List of Pairs (no parens)';
566-
# my constant %mihs3 = (:42foo, :70bar);
567-
# is-deeply %mihs3, Map.new((:42foo, :70bar)),
568-
# 'def, List of Pairs (with parens)';
548+
549+
my constant %mihs1 = 1, 2, 3, 4;
550+
is-deeply %mihs1, Map.new((1 => 2, 3 => 4)), 'def, List of values';
551+
my constant %mihs2 = :42foo, :70bar;
552+
is-deeply %mihs2, Map.new((:42foo, :70bar)),
553+
'def, List of Pairs (no parens)';
554+
my constant %mihs3 = (:42foo, :70bar);
555+
is-deeply %mihs3, Map.new((:42foo, :70bar)),
556+
'def, List of Pairs (with parens)';
569557
my constant %mihs4 = Map.new: (:42foo, :70bar);
570558
is-deeply %mihs4, Map.new((:42foo, :70bar)), 'def, Map';
571559
for %mihs4 { isa-ok $_, Pair, 'does not scalarize'; last }
@@ -583,52 +571,47 @@ subtest 'my | implied | %-sigilled' => {
583571
my constant %mihs9 = do { %(:foo, :bar) };
584572
is-deeply %mihs9, %(:foo, :bar), 'def, statement';
585573
}
586-
nok ::('%mihs6'), '`my` makes constants lexical';
587-
588-
# XXX TODO
589-
skip 'compilation fails ATM', 1;
590-
# EVAL 「
591-
# my class Foo {
592-
# method Map {
593-
# pass 'coercion calls .Map method';
594-
# Map.new: (:42foo, :70bar)
595-
# }
596-
# }
597-
# my constant %mihs10 = Foo.new;
598-
# is-deeply %mihs10, Map.new((:42foo, :70bar)),
599-
# 'right result after coersion';
600-
# 」;
574+
nok ::('%mihs9'), '`my` makes constants lexical';
575+
576+
EVAL
577+
my class Foo {
578+
method Map {
579+
pass 'coercion calls .Map method';
580+
Map.new: (:42foo, :70bar)
581+
}
582+
}
583+
my constant %mihs10 = Foo.new;
584+
is-deeply %mihs10, Map.new((:42foo, :70bar)),
585+
'right result after coersion';
586+
;
601587

602588
throws-like
603589
my class Foo { method Map { 42 } }
604590
my constant %mihs11 = Foo.new;
605591
, X::TypeCheck, 'typecheck fails if .Map does not return Associative';
606592

607-
# TODO XXX
608-
skip 'fails compilation';
609-
# EVAL 「
610-
# my class Bar does Associative {
611-
# method Map { flunk 'called .Map on an already-Associative' }
612-
# }
613-
# my constant %mihs12 = Bar.new;
614-
# isa-ok %mihs12, Bar, 'no coercion of custom Associative';
615-
# 」;
593+
EVAL
594+
my class Bar does Associative {
595+
method Map { flunk 'called .Map on an already-Associative' }
596+
}
597+
my constant %mihs12 = Bar.new;
598+
isa-ok %mihs12, Bar, 'no coercion of custom Associative';
599+
;
616600
}
617601

618602
subtest 'our | implied | %-sigilled' => {
619-
plan 14;
603+
plan 16;
620604
throws-like our constant %oihs0 = 42, X::Hash::Store::OddNumber,
621605
'def, simple value';
622-
# XXX TODO
623-
skip 'compilation fails ATM', 3;
624-
# our constant %oihs1 = 1, 2, 3, 4;
625-
# is-deeply %oihs1, Map.new((1 => 2, 3 => 4)), 'def, List of values';
626-
# our constant %oihs2 = :42foo, :70bar;
627-
# is-deeply %oihs2, Map.new((:42foo, :70bar)),
628-
# 'def, List of Pairs (no parens)';
629-
# our constant %oihs3 = (:42foo, :70bar);
630-
# is-deeply %oihs3, Map.new((:42foo, :70bar)),
631-
# 'def, List of Pairs (with parens)';
606+
607+
our constant %oihs1 = 1, 2, 3, 4;
608+
is-deeply %oihs1, Map.new((1 => 2, 3 => 4)), 'def, List of values';
609+
our constant %oihs2 = :42foo, :70bar;
610+
is-deeply %oihs2, Map.new((:42foo, :70bar)),
611+
'def, List of Pairs (no parens)';
612+
our constant %oihs3 = (:42foo, :70bar);
613+
is-deeply %oihs3, Map.new((:42foo, :70bar)),
614+
'def, List of Pairs (with parens)';
632615
our constant %oihs4 = Map.new: (:42foo, :70bar);
633616
is-deeply %oihs4, Map.new((:42foo, :70bar)), 'def, Map';
634617
for %oihs4 { isa-ok $_, Pair, 'does not scalarize'; last }
@@ -648,34 +631,30 @@ subtest 'our | implied | %-sigilled' => {
648631
}
649632
ok ::('%oihs9'), 'implied scope declarator behaves like `our`';
650633

651-
# XXX TODO
652-
skip 'compilation fails ATM', 1;
653-
# EVAL 「
654-
# my class Foo {
655-
# method Map {
656-
# pass 'coercion calls .Map method';
657-
# Map.new: (:42foo, :70bar)
658-
# }
659-
# }
660-
# our constant %oihs10 = Foo.new;
661-
# is-deeply %oihs10, Map.new((:42foo, :70bar)),
662-
# 'right result after coersion';
663-
# 」;
634+
EVAL
635+
my class Foo {
636+
method Map {
637+
pass 'coercion calls .Map method';
638+
Map.new: (:42foo, :70bar)
639+
}
640+
}
641+
our constant %oihs10 = Foo.new;
642+
is-deeply %oihs10, Map.new((:42foo, :70bar)),
643+
'right result after coersion';
644+
;
664645

665646
throws-like
666647
my class Foo { method Map { 42 } }
667648
our constant %oihs11 = Foo.new;
668649
, X::TypeCheck, 'typecheck fails if .Map does not return Associative';
669650

670-
# TODO XXX
671-
skip 'fails compilation';
672-
# EVAL 「
673-
# my class Bar does Associative {
674-
# method Map { flunk 'called .Map on an already-Associative' }
675-
# }
676-
# our constant %oihs12 = Bar.new;
677-
# isa-ok %oihs12, Bar, 'no coercion of custom Associative';
678-
# 」;
651+
EVAL
652+
my class Bar does Associative {
653+
method Map { flunk 'called .Map on an already-Associative' }
654+
}
655+
our constant %oihs12 = Bar.new;
656+
isa-ok %oihs12, Bar, 'no coercion of custom Associative';
657+
;
679658
}
680659

681660
subtest 'my | typed | %-sigilled' => {

0 commit comments

Comments
 (0)