Showing 1 of 2 files from the diff.

@@ -79,4 +79,19 @@
Loading
79 79
        }
80 80
        XCTAssertTrue(output.hasPrefix("En un lugar de L. M."))
81 81
    }
82 +
83 +
    func testIntegers() throws {
84 +
        let regex = try RegEx(pattern: #"(\d)(\d)"#)
85 +
        let output = regex.replaceMatches(in: "1234", withTemplate: "$2$1")
86 +
        XCTAssertEqual(output, "2143")
87 +
    }
88 +
89 +
    func testReverseWords() throws {
90 +
        let regex = try RegEx(pattern: #"(\w+)\b"#)
91 +
        let output = regex.replaceMatches(in: "Hello world!")  { match in
92 +
            let value = String(match.values[0] ?? "")
93 +
            return String(value.reversed())
94 +
        }
95 +
        XCTAssertEqual(output, "olleH dlrow!")
96 +
    }
82 97
}
Files Coverage
Tests/RegExTests 100.00%
Project Totals (5 files) 100.00%
36.3
TRAVIS_OS_NAME=osx
37.3
TRAVIS_OS_NAME=osx
38.3
TRAVIS_OS_NAME=osx
39.3
TRAVIS_OS_NAME=osx
32.3
TRAVIS_OS_NAME=osx
33.3
TRAVIS_OS_NAME=osx
34.3
TRAVIS_OS_NAME=osx
35.3
TRAVIS_OS_NAME=osx
40.3
TRAVIS_OS_NAME=osx
41.3
TRAVIS_OS_NAME=osx
25.3
TRAVIS_OS_NAME=osx
15.3
TRAVIS_OS_NAME=osx
20.3
TRAVIS_OS_NAME=osx
71.3
TRAVIS_OS_NAME=osx
70.3
TRAVIS_OS_NAME=osx
67.3
TRAVIS_OS_NAME=osx
66.3
TRAVIS_OS_NAME=osx
69.3
TRAVIS_OS_NAME=osx
68.3
TRAVIS_OS_NAME=osx
63.3
TRAVIS_OS_NAME=osx