@@ -16,8 +16,8 @@ class AGRegexTest: XCTestCase {
1616 let r = try ! NSRegularExpression ( pattern: " ai " , options: [ ] )
1717 let regex = AGRegex ( r)
1818 let str = " The rain in Spain "
19- let actual = regex. getMatchList ( str)
20- let expect = AGMatchList ( withBase : str, matching: [
19+ let actual = regex. matchAll ( str)
20+ let expect = AGMatchList ( base : str, matching: [
2121 AGMatch ( start: 5 , end: 7 , base: str, groups: [ " ai " ] ) ,
2222 AGMatch ( start: 14 , end: 16 , base: str, groups: [ " ai " ] ) ,
2323 ] )
@@ -29,7 +29,7 @@ class AGRegexTest: XCTestCase {
2929 let r = try ! NSRegularExpression ( pattern: " ai " , options: [ ] )
3030 let regex = AGRegex ( r)
3131 let str = " The rain in Spain "
32- let actual = regex. getMatchList ( str) . first
32+ let actual = regex. matchAll ( str) . first
3333 let expect = AGMatch ( start: 5 , end: 7 , base: str, groups: [ " ai " ] )
3434 XCTAssertEqual ( actual, expect)
3535 }
@@ -38,7 +38,7 @@ class AGRegexTest: XCTestCase {
3838 let r = try ! NSRegularExpression ( pattern: " ai " , options: [ ] )
3939 let regex = AGRegex ( r)
4040 let str = " The rain in Spain "
41- let actual = regex. getMatchList ( str) . last
41+ let actual = regex. matchAll ( str) . last
4242 let expect = AGMatch ( start: 14 , end: 16 , base: str, groups: [ " ai " ] )
4343 XCTAssertEqual ( actual, expect)
4444 }
@@ -75,7 +75,7 @@ class AGRegexTest: XCTestCase {
7575 ]
7676
7777 var testCount = 0
78- for (i, m) in regex. getMatchList ( str) . enumerated ( ) {
78+ for (i, m) in regex. matchAll ( str) . enumerated ( ) {
7979 let actual = " \( m. group ( 2 ) ) * \( m. group ( 1 ) ) "
8080 let expect = expects [ i]
8181 XCTAssertEqual ( actual, expect)
0 commit comments