Refactor illegal delimiters specs
This commit is contained in:
parent
e2841dc26c
commit
77d3fa46d5
1 changed files with 12 additions and 12 deletions
|
|
@ -449,19 +449,19 @@ describe "the commands", ->
|
|||
submitNormalModeInputText(':%substitute/abc/ghi/ig')
|
||||
expect(editor.getText()).toEqual('ghiaghi\ndefdDEF\nghiaghi')
|
||||
|
||||
it "can't be delimited by letters", ->
|
||||
keydown(':')
|
||||
submitNormalModeInputText(':substitute nanxngi')
|
||||
expect(atom.notifications.notifications[0].message).toEqual(
|
||||
"Command error: Regular expressions can't be delimited by alphanumeric characters, '\\', '\"' or '|'")
|
||||
expect(editor.getText()).toEqual('abcaABC\ndefdDEF\nabcaABC')
|
||||
describe "illegal delimiters", ->
|
||||
test = (delim) ->
|
||||
keydown(':')
|
||||
submitNormalModeInputText(":substitute #{delim}a#{delim}x#{delim}gi")
|
||||
expect(atom.notifications.notifications[0].message).toEqual(
|
||||
"Command error: Regular expressions can't be delimited by alphanumeric characters, '\\', '\"' or '|'")
|
||||
expect(editor.getText()).toEqual('abcaABC\ndefdDEF\nabcaABC')
|
||||
|
||||
it "can't be delimited by numbers", ->
|
||||
keydown(':')
|
||||
submitNormalModeInputText(':substitute 1a1x1gi')
|
||||
expect(atom.notifications.notifications[0].message).toEqual(
|
||||
"Command error: Regular expressions can't be delimited by alphanumeric characters, '\\', '\"' or '|'")
|
||||
expect(editor.getText()).toEqual('abcaABC\ndefdDEF\nabcaABC')
|
||||
it "can't be delimited by letters", -> test 'n'
|
||||
it "can't be delimited by numbers", -> test '3'
|
||||
it "can't be delimited by '\\'", -> test '\\'
|
||||
it "can't be delimited by '\"'", -> test '"'
|
||||
it "can't be delimited by '|'", -> test '|'
|
||||
|
||||
describe "capturing groups", ->
|
||||
beforeEach ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue