@@ -315,7 +315,7 @@ subtest 'our | typed | $-sigilled' => {
315
315
# #
316
316
317
317
subtest ' implied | implied | @-sigilled' => {
318
- plan 12 ;
318
+ plan 13 ;
319
319
constant @ iias1 = 42 ;
320
320
is-deeply @ iias1 , (42 ,), ' def, simple value' ;
321
321
constant @ iias2 = 1 , 2 , 3 ;
@@ -352,19 +352,17 @@ subtest 'implied | implied | @-sigilled' => {
352
352
constant @iias8 = Foo.new;
353
353
」 , X::TypeCheck , ' typecheck fails if .cache does not return Positional' ;
354
354
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
+ 」 ;
364
362
}
365
363
366
364
subtest ' my | implied | @-sigilled' => {
367
- plan 12 ;
365
+ plan 13 ;
368
366
my constant @ mias1 = 42 ;
369
367
is-deeply @ mias1 , (42 ,), ' def, simple value' ;
370
368
my constant @ mias2 = 1 , 2 , 3 ;
@@ -401,19 +399,17 @@ subtest 'my | implied | @-sigilled' => {
401
399
my constant @mias8 = Foo.new;
402
400
」 , X::TypeCheck , ' typecheck fails if .cache does not return Positional' ;
403
401
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
+ 」 ;
413
409
}
414
410
415
411
subtest ' our | implied | @-sigilled' => {
416
- plan 12 ;
412
+ plan 13 ;
417
413
our constant @ oias1 = 42 ;
418
414
is-deeply @ oias1 , (42 ,), ' def, simple value' ;
419
415
our constant @ oias2 = 1 , 2 , 3 ;
@@ -450,15 +446,13 @@ subtest 'our | implied | @-sigilled' => {
450
446
our constant @oias8 = Foo.new;
451
447
」 , X::TypeCheck , ' typecheck fails if .cache does not return Positional' ;
452
448
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
+ 」 ;
462
456
}
463
457
464
458
subtest ' my | typed | @-sigilled' => {
@@ -490,19 +484,18 @@ subtest 'our | typed | @-sigilled' => {
490
484
# #
491
485
492
486
subtest ' implied | implied | %-sigilled' => {
493
- plan 14 ;
487
+ plan 16 ;
494
488
throws-like 「 constant %iihs0 = 42」 , X::Hash::Store::OddNumber ,
495
489
' 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 = : 42 foo, : 70 bar;
494
+ is-deeply % iihs2 , Map . new ((: 42 foo, : 70 bar)),
495
+ ' def, List of Pairs (no parens)' ;
496
+ constant % iihs3 = (: 42 foo, : 70 bar);
497
+ is-deeply % iihs3 , Map . new ((: 42 foo, : 70 bar)),
498
+ ' def, List of Pairs (with parens)' ;
506
499
constant % iihs4 = Map . new : (: 42 foo, : 70 bar);
507
500
is-deeply % iihs4 , Map . new ((: 42 foo, : 70 bar)), ' def, Map' ;
508
501
for % iihs4 { isa-ok $ _ , Pair , ' does not scalarize' ; last }
@@ -522,50 +515,45 @@ subtest 'implied | implied | %-sigilled' => {
522
515
}
523
516
ok ::(' %iihs9' ), ' implied scope declarator behaves like `our`' ;
524
517
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
+ 」 ;
538
529
539
530
throws-like 「
540
531
my class Foo { method Map { 42 } }
541
532
constant %iihs11 = Foo.new;
542
533
」 , X::TypeCheck , ' typecheck fails if .Map does not return Associative' ;
543
534
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
+ 」 ;
553
542
}
554
543
555
544
subtest ' my | implied | %-sigilled' => {
556
- plan 14 ;
545
+ plan 16 ;
557
546
throws-like 「 my constant %mihs0 = 42」 , X::Hash::Store::OddNumber ,
558
547
' 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 = : 42 foo, : 70 bar;
552
+ is-deeply % mihs2 , Map . new ((: 42 foo, : 70 bar)),
553
+ ' def, List of Pairs (no parens)' ;
554
+ my constant % mihs3 = (: 42 foo, : 70 bar);
555
+ is-deeply % mihs3 , Map . new ((: 42 foo, : 70 bar)),
556
+ ' def, List of Pairs (with parens)' ;
569
557
my constant % mihs4 = Map . new : (: 42 foo, : 70 bar);
570
558
is-deeply % mihs4 , Map . new ((: 42 foo, : 70 bar)), ' def, Map' ;
571
559
for % mihs4 { isa-ok $ _ , Pair , ' does not scalarize' ; last }
@@ -583,52 +571,47 @@ subtest 'my | implied | %-sigilled' => {
583
571
my constant % mihs9 = do { % (: foo, : bar) };
584
572
is-deeply % mihs9 , % (: foo, : bar), ' def, statement' ;
585
573
}
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
+ 」 ;
601
587
602
588
throws-like 「
603
589
my class Foo { method Map { 42 } }
604
590
my constant %mihs11 = Foo.new;
605
591
」 , X::TypeCheck , ' typecheck fails if .Map does not return Associative' ;
606
592
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
+ 」 ;
616
600
}
617
601
618
602
subtest ' our | implied | %-sigilled' => {
619
- plan 14 ;
603
+ plan 16 ;
620
604
throws-like 「 our constant %oihs0 = 42」 , X::Hash::Store::OddNumber ,
621
605
' 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 = : 42 foo, : 70 bar;
610
+ is-deeply % oihs2 , Map . new ((: 42 foo, : 70 bar)),
611
+ ' def, List of Pairs (no parens)' ;
612
+ our constant % oihs3 = (: 42 foo, : 70 bar);
613
+ is-deeply % oihs3 , Map . new ((: 42 foo, : 70 bar)),
614
+ ' def, List of Pairs (with parens)' ;
632
615
our constant % oihs4 = Map . new : (: 42 foo, : 70 bar);
633
616
is-deeply % oihs4 , Map . new ((: 42 foo, : 70 bar)), ' def, Map' ;
634
617
for % oihs4 { isa-ok $ _ , Pair , ' does not scalarize' ; last }
@@ -648,34 +631,30 @@ subtest 'our | implied | %-sigilled' => {
648
631
}
649
632
ok ::(' %oihs9' ), ' implied scope declarator behaves like `our`' ;
650
633
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
+ 」 ;
664
645
665
646
throws-like 「
666
647
my class Foo { method Map { 42 } }
667
648
our constant %oihs11 = Foo.new;
668
649
」 , X::TypeCheck , ' typecheck fails if .Map does not return Associative' ;
669
650
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
+ 」 ;
679
658
}
680
659
681
660
subtest ' my | typed | %-sigilled' => {
0 commit comments