         let lineString2 = LineString("dog \n\n cat \n cow ")
         XCTAssertEqual(lineString2.lineRange(at: 17), NSRange(12..<17))
         
-        for _ in (0..<10) {
+        for _ in (0..<20) {
             let string = String(" 🐶 \n 🐱 \n 🐮 \n".shuffled())
             let lineString = LineString(string)
             

        let lineString2 = LineString("dog \n\n cat \n cow ")
        XCTAssertEqual(lineString2.lineNumber(at: 17), 4)
        
        for _ in (0..<10) {
            let string = String(" 🐶 \n 🐱 \n 🐮 \n".shuffled())
            let lineString = LineString(string)
            

            let location = Int.random(in: 0..<(string.length - 1))
            let length = Int.random(in: 0..<(string.length - location))
            let range = NSRange(location: location, length: length)
            let replacement = String("ab\nc".prefix(Int.random(in: 0...4)).shuffled())
            
            lineString.string = lineString.string.replacingCharacters(in: range, with: replacement) as NSString
            lineString.invalidateLineRanges(from: range.location)
            
            for index in (0..<lineString.string.length).shuffled() {
                XCTAssertEqual(lineString.lineNumber(at: index), lineString.string.lineNumber(at: index),
                               "At \(index) with string \"\(lineString.string)\"")
                XCTAssertEqual(lineString.lineRange(at: index), lineString.string.lineRange(at: index),
                               "At \(index) with string \"\(lineString.string)\"")
                XCTAssertEqual(lineString.lineStartIndex(at: index), lineString.string.lineStartIndex(at: index),
                               "At \(index) with string \"\(lineString.string)\"")
            }
        }
    }
