5
5
// Created by Abizer Nasir on 22/05/2011.
6
6
//
7
7
8
- #import < SenTestingKit/SenTestingKit.h>
8
+ // #import <SenTestingKit/SenTestingKit.h>
9
+ #import < XCTest/XCTest.h>
9
10
#import " KSPathUtilities.h"
10
11
11
12
12
- @interface TestKSPathUtilities : SenTestCase {
13
+ @interface TestKSPathUtilities : XCTestCase {
13
14
@private
14
15
15
16
}
@@ -29,7 +30,7 @@ - (void)checkPath:(NSString *)path relativeToDirectory:(NSString *)dirPath again
29
30
{
30
31
NSString *result = [path ks_pathRelativeToDirectory: dirPath];
31
32
32
- STAssertTrue ([result isEqualToString: expectedResult],
33
+ XCTAssertTrue ([result isEqualToString: expectedResult],
33
34
@" \' %@ \' relative to \' %@ \' should be \' %@ \' instead of \' %@ \' " ,
34
35
path,
35
36
dirPath,
@@ -54,16 +55,16 @@ - (void)checkPath:(NSString *)path relativeToDirectory:(NSString *)dirPath again
54
55
55
56
- (void )testEnumeratePathComponents ;
56
57
{
57
- STAssertEqualObjects ([self componentsOfPath: @" foo/bar" ], (@[@" foo" , @" bar" ]), nil );
58
- STAssertEqualObjects ([self componentsOfPath: @" foo/bar/" ], (@[@" foo" , @" bar" ]), nil );
59
- STAssertEqualObjects ([self componentsOfPath: @" foo//bar/" ], (@[@" foo" , @" bar" ]), nil );
60
-
61
- STAssertEqualObjects ([self componentsOfPath: @" /" ], (@[@" /" ]), nil );
62
- STAssertEqualObjects ([self componentsOfPath: @" //" ], (@[@" /" ]), nil );
63
- STAssertEqualObjects ([self componentsOfPath: @" /foo/bar" ], (@[@" /" , @" foo" , @" bar" ]), nil );
64
- STAssertEqualObjects ([self componentsOfPath: @" /foo/bar/" ], (@[@" /" , @" foo" , @" bar" ]), nil );
65
- STAssertEqualObjects ([self componentsOfPath: @" /foo//bar/" ], (@[@" /" , @" foo" , @" bar" ]), nil );
66
- STAssertEqualObjects ([self componentsOfPath: @" //foo//bar/" ], (@[@" /" , @" foo" , @" bar" ]), nil );
58
+ XCTAssertEqual ([self componentsOfPath: @" foo/bar" ], (@[@" foo" , @" bar" ]));
59
+ XCTAssertEqual ([self componentsOfPath: @" foo/bar/" ], (@[@" foo" , @" bar" ]));
60
+ XCTAssertEqual ([self componentsOfPath: @" foo//bar/" ], (@[@" foo" , @" bar" ]));
61
+
62
+ XCTAssertEqual ([self componentsOfPath: @" /" ], (@[@" /" ]));
63
+ XCTAssertEqual ([self componentsOfPath: @" //" ], (@[@" /" ]));
64
+ XCTAssertEqual ([self componentsOfPath: @" /foo/bar" ], (@[@" /" , @" foo" , @" bar" ]));
65
+ XCTAssertEqual ([self componentsOfPath: @" /foo/bar/" ], (@[@" /" , @" foo" , @" bar" ]));
66
+ XCTAssertEqual ([self componentsOfPath: @" /foo//bar/" ], (@[@" /" , @" foo" , @" bar" ]));
67
+ XCTAssertEqual ([self componentsOfPath: @" //foo//bar/" ], (@[@" /" , @" foo" , @" bar" ]));
67
68
}
68
69
69
70
- (NSArray *)componentsOfPath : (NSString *)path ;
@@ -170,34 +171,34 @@ - (void)testPathRelativeToDirectory {
170
171
171
172
- (void )testIsSubpath ;
172
173
{
173
- STAssertTrue ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /foo" ], @" /foo/bar/baz.html is a subpath of of /foo" );
174
- STAssertTrue ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /foo/" ], @" /foo/bar/baz.html is a subpath of of /foo/" );
175
- STAssertFalse ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /fo" ], nil );
174
+ XCTAssertTrue ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /foo" ], @" /foo/bar/baz.html is a subpath of of /foo" );
175
+ XCTAssertTrue ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /foo/" ], @" /foo/bar/baz.html is a subpath of of /foo/" );
176
+ XCTAssertFalse ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /fo" ]);
176
177
177
178
// Treat items as being subpaths of themselves
178
- STAssertTrue ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /foo/bar/baz.html" ], nil );
179
- STAssertTrue ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /foo/bar/baz.html/" ], nil );
180
- STAssertTrue ([@" /foo/bar/baz.html/" ks_isSubpathOfPath: @" /foo/bar/baz.html" ], nil );
181
- STAssertTrue ([@" /foo/bar/baz.html/" ks_isSubpathOfPath: @" /foo/bar/baz.html/" ], nil );
179
+ XCTAssertTrue ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /foo/bar/baz.html" ]);
180
+ XCTAssertTrue ([@" /foo/bar/baz.html" ks_isSubpathOfPath: @" /foo/bar/baz.html/" ]);
181
+ XCTAssertTrue ([@" /foo/bar/baz.html/" ks_isSubpathOfPath: @" /foo/bar/baz.html" ]);
182
+ XCTAssertTrue ([@" /foo/bar/baz.html/" ks_isSubpathOfPath: @" /foo/bar/baz.html/" ]);
182
183
183
184
// Make sure similar things aren't mistaken
184
- STAssertFalse ([@" /foo/abcdefg" ks_isSubpathOfPath: @" /foo/abcd" ], nil );
185
- STAssertFalse ([@" /foo/abcd" ks_isSubpathOfPath: @" /foo/abcdefg" ], nil );
185
+ XCTAssertFalse ([@" /foo/abcdefg" ks_isSubpathOfPath: @" /foo/abcd" ]);
186
+ XCTAssertFalse ([@" /foo/abcd" ks_isSubpathOfPath: @" /foo/abcdefg" ]);
186
187
}
187
188
188
189
- (void )testStringByIncrementingPath ;
189
190
{
190
191
NSString *path = @" foo/bar.png//" ;
191
192
path = [path ks_stringByIncrementingPath ];
192
193
193
- STAssertTrue ([path isEqualToString: @" foo/bar-2.png" ],
194
+ XCTAssertTrue ([path isEqualToString: @" foo/bar-2.png" ],
194
195
@" Incremented path \' %@ \' should be \' %@ \' " ,
195
196
path,
196
197
@" foo/bar-2.png" );
197
198
198
199
path = [path ks_stringByIncrementingPath ];
199
200
200
- STAssertTrue ([path isEqualToString: @" foo/bar-3.png" ],
201
+ XCTAssertTrue ([path isEqualToString: @" foo/bar-3.png" ],
201
202
@" Incremented path \' %@ \' should be \' %@ \' " ,
202
203
path,
203
204
@" foo/bar-3.png" );
@@ -207,14 +208,14 @@ - (void)testStringByIncrementingPath;
207
208
path = @" foo/bar//" ;
208
209
path = [path ks_stringByIncrementingPath ];
209
210
210
- STAssertTrue ([path isEqualToString: @" foo/bar-2" ],
211
+ XCTAssertTrue ([path isEqualToString: @" foo/bar-2" ],
211
212
@" Incremented path \' %@ \' should be \' %@ \' " ,
212
213
path,
213
214
@" foo/bar-2" );
214
215
215
216
path = [path ks_stringByIncrementingPath ];
216
217
217
- STAssertTrue ([path isEqualToString: @" foo/bar-3" ],
218
+ XCTAssertTrue ([path isEqualToString: @" foo/bar-3" ],
218
219
@" Incremented path \' %@ \' should be \' %@ \' " ,
219
220
path,
220
221
@" foo/bar-3" );
0 commit comments