mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-14 04:29:04 +03:00
031da13316
`OnigScanner` takes over these duties
14 lines
503 B
CoffeeScript
14 lines
503 B
CoffeeScript
describe "OnigRegExp", ->
|
|
describe ".search(string, index)", ->
|
|
it "returns an array of the match and all capture groups", ->
|
|
regex = new OnigRegExp("\\w(\\d+)")
|
|
result = regex.search("----a123----")
|
|
expect(result).toEqual ["a123", "123"]
|
|
expect(result.index).toBe 4
|
|
expect(result.indices).toEqual [4, 5]
|
|
|
|
it "returns null if it does not match", ->
|
|
regex = new OnigRegExp("\\w(\\d+)")
|
|
result = regex.search("--------")
|
|
expect(result).toBeNull()
|