@@ -61,19 +61,16 @@ final class SnapshotTests: XCTestCase {
6161
6262 func testInitWithCharacters( ) {
6363 snapshot = Snapshot ( " AB " )
64-
6564 Assert ( " AB " , [ . content, . content] )
6665 }
6766
6867 func testInitAsArrayLiteral( ) {
6968 snapshot = [ Symbol ( " A " ) , Symbol ( " B " , as: . phantom) ]
70-
7169 Assert ( " AB " , [ . content, . phantom] )
7270 }
7371
7472 func testInitAsStringLiteral( ) {
75- snapshot = " AB " as Snapshot
76-
73+ snapshot = " AB "
7774 Assert ( " AB " , [ . content, . content] )
7875 }
7976
@@ -83,7 +80,7 @@ final class SnapshotTests: XCTestCase {
8380
8481 func testNonvirtualsIgnoresVirtualSymbols( ) {
8582 snapshot = [ " A " , Symbol ( " _ " , as: . virtual) , " B " ]
86- XCTAssertEqual ( String ( snapshot. nonvirtuals) , " AB " )
83+ XCTAssertEqual ( snapshot. nonvirtuals ( ) , " AB " )
8784 }
8885
8986 //=------------------------------------------------------------------------=
@@ -92,10 +89,10 @@ final class SnapshotTests: XCTestCase {
9289
9390 func testSelectEndIndex( ) {
9491 snapshot. append ( Symbol ( " " ) )
95- snapshot. select ( snapshot. endIndex )
92+ let index = snapshot. endIndex; snapshot. select ( index )
9693 snapshot. append ( Symbol ( " " ) )
9794
98- XCTAssertEqual ( snapshot. selection, Selection ( snapshot . index ( at : C ( 1 ) ) ) )
95+ XCTAssertEqual ( snapshot. selection, Selection ( index) )
9996 }
10097
10198 //=------------------------------------------------------------------------=
@@ -105,14 +102,12 @@ final class SnapshotTests: XCTestCase {
105102 func testAppendSymbol( ) {
106103 snapshot. append ( Symbol ( " A " ) )
107104 snapshot. append ( Symbol ( " B " , as: . phantom) )
108-
109105 Assert ( " AB " , [ . content, . phantom] )
110106 }
111107
112108 func testAppendCharacter( ) {
113109 snapshot. append ( Character ( " A " ) )
114110 snapshot. append ( Character ( " B " ) , as: . phantom)
115-
116111 Assert ( " AB " , [ . content, . phantom] )
117112 }
118113
@@ -123,14 +118,12 @@ final class SnapshotTests: XCTestCase {
123118 func testAppendContentsOfSymbols( ) {
124119 snapshot. append ( contentsOf: Snapshot ( " A " , as: . content) )
125120 snapshot. append ( contentsOf: Snapshot ( " B " , as: . phantom) )
126-
127121 Assert ( " AB " , [ . content, . phantom] )
128122 }
129123
130124 func testAppendContentsOfCharacters( ) {
131125 snapshot. append ( contentsOf: String ( " A " ) )
132126 snapshot. append ( contentsOf: String ( " B " ) , as: . phantom)
133-
134127 Assert ( " AB " , [ . content, . phantom] )
135128 }
136129
@@ -141,14 +134,12 @@ final class SnapshotTests: XCTestCase {
141134 func testInsertSymbol( ) {
142135 snapshot. insert ( Symbol ( " B " , as: . phantom) , at: snapshot. startIndex)
143136 snapshot. insert ( Symbol ( " A " , as: . content) , at: snapshot. startIndex)
144-
145137 Assert ( " AB " , [ . content, . phantom] )
146138 }
147139
148140 func testInsertCharacter( ) {
149141 snapshot. insert ( Character ( " B " ) , at: snapshot. startIndex, as: . phantom)
150142 snapshot. insert ( Character ( " A " ) , at: snapshot. startIndex)
151-
152143 Assert ( " AB " , [ . content, . phantom] )
153144 }
154145
@@ -159,14 +150,12 @@ final class SnapshotTests: XCTestCase {
159150 func testInsertContentsOfSymbols( ) {
160151 snapshot. insert ( contentsOf: Snapshot ( " B " , as: . phantom) , at: snapshot. startIndex)
161152 snapshot. insert ( contentsOf: Snapshot ( " A " , as: . content) , at: snapshot. startIndex)
162-
163153 Assert ( " AB " , [ . content, . phantom] )
164154 }
165155
166156 func testInsertContentsOfCharacters( ) {
167157 snapshot. insert ( contentsOf: String ( " B " ) , at: snapshot. startIndex, as: . phantom)
168158 snapshot. insert ( contentsOf: String ( " A " ) , at: snapshot. startIndex)
169-
170159 Assert ( " AB " , [ . content, . phantom] )
171160 }
172161
@@ -178,15 +167,13 @@ final class SnapshotTests: XCTestCase {
178167 snapshot = Snapshot ( repeating: " " , count: 4 )
179168 snapshot. replaceSubrange ( snapshot. indices ( at: C ( 0 ) ..< 2 ) , with: Snapshot ( " AA " , as: . content) )
180169 snapshot. replaceSubrange ( snapshot. indices ( at: C ( 2 ) ..< 4 ) , with: Snapshot ( " BB " , as: . phantom) )
181-
182170 Assert ( " AABB " , [ . content, . content, . phantom, . phantom] )
183171 }
184172
185173 func testReplaceSubrangeWithCharacters( ) {
186174 snapshot = Snapshot ( repeating: " " , count: 4 )
187175 snapshot. replaceSubrange ( snapshot. indices ( at: C ( 0 ) ..< 2 ) , with: Snapshot ( " AA " , as: . content) )
188176 snapshot. replaceSubrange ( snapshot. indices ( at: C ( 2 ) ..< 4 ) , with: Snapshot ( " BB " , as: . phantom) )
189-
190177 Assert ( " AABB " , [ . content, . content, . phantom, . phantom] )
191178 }
192179
0 commit comments