-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
648fb0f
commit 59f63f3
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// Copyright 2024 Readium Foundation. All rights reserved. | ||
// Use of this source code is governed by the BSD-style license | ||
// available in the top-level LICENSE file of the project. | ||
// | ||
|
||
import Foundation | ||
@testable import ReadiumInternal | ||
import XCTest | ||
|
||
class StringTests: XCTestCase { | ||
func testSubstringBeforeLast() { | ||
XCTAssertEqual("href".substringBeforeLast("#"), "href") | ||
XCTAssertEqual("href#anchor".substringBeforeLast("#"), "href") | ||
XCTAssertEqual("href#anchor#test".substringBeforeLast("#"), "href#anchor") | ||
} | ||
} |