@@ -582,6 +582,17 @@ class ClassVeryPrintable : CustomStringConvertible, CustomDebugStringConvertible
582
582
}
583
583
}
584
584
585
+ func test_ThickMetatypePrintingImpl< T> (
586
+ thickMetatype: T . Type ,
587
+ _ expectedPrint: String ,
588
+ _ expectedDebug: String
589
+ ) {
590
+ expectPrinted ( expectedPrint, thickMetatype)
591
+ expectPrinted ( " [ \( expectedDebug) ] " , [ thickMetatype ] )
592
+ expectDebugPrinted ( expectedDebug, thickMetatype)
593
+ expectDebugPrinted ( " [ \( expectedDebug) ] " , [ thickMetatype ] )
594
+ }
595
+
585
596
PrintTests . test ( " StructPrintable " ) {
586
597
let s0 = StructPrintable ( 1 )
587
598
let s1 : ProtocolUnrelatedToPrinting = StructPrintable ( 1 )
@@ -592,6 +603,14 @@ PrintTests.test("StructPrintable") {
592
603
expectPrinted ( " ►1◀︎ " , s1)
593
604
expectPrinted ( " ►1◀︎ " , s2)
594
605
expectPrinted ( " ►1◀︎ " , s3)
606
+
607
+ let structMetatype = StructPrintable . self
608
+ expectPrinted ( " StructPrintable " , structMetatype)
609
+ expectDebugPrinted ( " a.StructPrintable " , structMetatype)
610
+ expectPrinted ( " [a.StructPrintable] " , [ structMetatype ] )
611
+ expectDebugPrinted ( " [a.StructPrintable] " , [ structMetatype ] )
612
+ test_ThickMetatypePrintingImpl ( structMetatype, " StructPrintable " ,
613
+ " a.StructPrintable " )
595
614
}
596
615
597
616
PrintTests . test ( " LargeStructPrintable " ) {
@@ -632,6 +651,14 @@ PrintTests.test("ClassPrintable") {
632
651
expectPrinted ( " ►1◀︎ " , c1)
633
652
expectPrinted ( " ►1◀︎ " , c2)
634
653
expectPrinted ( " ►1◀︎ " , c3)
654
+
655
+ let classMetatype = ClassPrintable . self
656
+ expectPrinted ( " ClassPrintable " , classMetatype)
657
+ expectDebugPrinted ( " a.ClassPrintable " , classMetatype)
658
+ expectPrinted ( " [a.ClassPrintable] " , [ classMetatype ] )
659
+ expectDebugPrinted ( " [a.ClassPrintable] " , [ classMetatype ] )
660
+ test_ThickMetatypePrintingImpl ( classMetatype, " ClassPrintable " ,
661
+ " a.ClassPrintable " )
635
662
}
636
663
637
664
PrintTests . test ( " ClassVeryPrintable " ) {
@@ -648,39 +675,6 @@ PrintTests.test("ClassVeryPrintable") {
648
675
expectPrinted ( " <description: 1> " , c4)
649
676
}
650
677
651
- func test_ThickMetatypePrintingImpl< T> (
652
- thickMetatype: T . Type ,
653
- _ expectedPrint: String ,
654
- _ expectedDebug: String
655
- ) {
656
- printedIs ( thickMetatype, expectedPrint)
657
- printedIs ( [ thickMetatype ] , " [ " + expectedDebug + " ] " )
658
- debugPrintedIs ( thickMetatype, expectedDebug)
659
- debugPrintedIs ( [ thickMetatype ] , " [ " + expectedDebug + " ] " )
660
- }
661
-
662
- func test_gcMetatypePrinting( ) {
663
- let structMetatype = StructPrintable . self
664
- printedIs ( structMetatype, " StructPrintable " )
665
- debugPrintedIs ( structMetatype, " a.StructPrintable " )
666
- printedIs ( [ structMetatype ] , " [a.StructPrintable] " )
667
- debugPrintedIs ( [ structMetatype ] , " [a.StructPrintable] " )
668
- test_ThickMetatypePrintingImpl ( structMetatype, " StructPrintable " ,
669
- " a.StructPrintable " )
670
-
671
- let classMetatype = ClassPrintable . self
672
- printedIs ( classMetatype, " ClassPrintable " )
673
- debugPrintedIs ( classMetatype, " a.ClassPrintable " )
674
- printedIs ( [ classMetatype ] , " [a.ClassPrintable] " )
675
- debugPrintedIs ( [ classMetatype ] , " [a.ClassPrintable] " )
676
- test_ThickMetatypePrintingImpl ( classMetatype, " ClassPrintable " ,
677
- " a.ClassPrintable " )
678
-
679
- print ( " test_gcMetatypePrinting done " )
680
- }
681
- test_gcMetatypePrinting ( )
682
- // CHECK: test_gcMetatypePrinting done
683
-
684
678
func test_ArrayPrinting( ) {
685
679
let arrayOfInts : [ Int ] = [ ]
686
680
printedIs ( arrayOfInts, " [] " )
0 commit comments