mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
12 lines
333 B
Swift
12 lines
333 B
Swift
import SwiftLintCore
|
|
import TestHelpers
|
|
import XCTest
|
|
|
|
final class ExtendedStringTests: SwiftLintTestCase {
|
|
func testCountOccurrences() {
|
|
XCTAssertEqual("aabbabaaba".countOccurrences(of: "a"), 6)
|
|
XCTAssertEqual("".countOccurrences(of: "a"), 0)
|
|
XCTAssertEqual("\n\n".countOccurrences(of: "\n"), 2)
|
|
}
|
|
}
|