@@ -812,6 +812,19 @@ final class StringTests : XCTestCase {
812
812
}
813
813
}
814
814
815
+ func testAppendingPathExtension( ) {
816
+ XCTAssertEqual ( " " . appendingPathExtension ( " foo " ) , " .foo " )
817
+ XCTAssertEqual ( " / " . appendingPathExtension ( " foo " ) , " /.foo " )
818
+ XCTAssertEqual ( " // " . appendingPathExtension ( " foo " ) , " //.foo " )
819
+ XCTAssertEqual ( " /path " . appendingPathExtension ( " foo " ) , " /path.foo " )
820
+ XCTAssertEqual ( " /path.zip " . appendingPathExtension ( " foo " ) , " /path.zip.foo " )
821
+ XCTAssertEqual ( " /path/ " . appendingPathExtension ( " foo " ) , " /path.foo/ " )
822
+ XCTAssertEqual ( " /path// " . appendingPathExtension ( " foo " ) , " /path.foo/ " )
823
+ XCTAssertEqual ( " path " . appendingPathExtension ( " foo " ) , " path.foo " )
824
+ XCTAssertEqual ( " path/ " . appendingPathExtension ( " foo " ) , " path.foo/ " )
825
+ XCTAssertEqual ( " path// " . appendingPathExtension ( " foo " ) , " path.foo/ " )
826
+ }
827
+
815
828
func testDeletingPathExtenstion( ) {
816
829
XCTAssertEqual ( " " . deletingPathExtension ( ) , " " )
817
830
XCTAssertEqual ( " / " . deletingPathExtension ( ) , " / " )
@@ -834,6 +847,15 @@ final class StringTests : XCTestCase {
834
847
XCTAssertEqual ( " /foo.bar/bar.baz/baz.zip " . deletingPathExtension ( ) , " /foo.bar/bar.baz/baz " )
835
848
XCTAssertEqual ( " /.././.././a.zip " . deletingPathExtension ( ) , " /.././.././a " )
836
849
XCTAssertEqual ( " /.././.././. " . deletingPathExtension ( ) , " /.././.././. " )
850
+
851
+ XCTAssertEqual ( " path.foo " . deletingPathExtension ( ) , " path " )
852
+ XCTAssertEqual ( " path.foo.zip " . deletingPathExtension ( ) , " path.foo " )
853
+ XCTAssertEqual ( " /path.foo " . deletingPathExtension ( ) , " /path " )
854
+ XCTAssertEqual ( " /path.foo.zip " . deletingPathExtension ( ) , " /path.foo " )
855
+ XCTAssertEqual ( " path.foo/ " . deletingPathExtension ( ) , " path/ " )
856
+ XCTAssertEqual ( " path.foo// " . deletingPathExtension ( ) , " path/ " )
857
+ XCTAssertEqual ( " /path.foo/ " . deletingPathExtension ( ) , " /path/ " )
858
+ XCTAssertEqual ( " /path.foo// " . deletingPathExtension ( ) , " /path/ " )
837
859
}
838
860
839
861
func test_dataUsingEncoding( ) {
0 commit comments