mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
update specs
This commit is contained in:
@@ -1336,7 +1336,9 @@ i = /test/; #FIXME\
|
||||
it('calls the callback with all regex results in all files in the project', () => {
|
||||
const results = []
|
||||
waitsForPromise(() =>
|
||||
atom.workspace.scan(/(a)+/, result => results.push(result))
|
||||
atom.workspace.scan(
|
||||
/(a)+/, {leadingContextLineCount: 1, trailingContextLineCount: 1},
|
||||
result => results.push(result))
|
||||
)
|
||||
|
||||
runs(() => {
|
||||
@@ -1349,14 +1351,16 @@ i = /test/; #FIXME\
|
||||
lineTextOffset: 0,
|
||||
range: [[0, 0], [0, 3]],
|
||||
leadingContextLines: [],
|
||||
trailingContextLines: []
|
||||
trailingContextLines: ['cc aa cc']
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('works with with escaped literals (like $ and ^)', () => {
|
||||
const results = []
|
||||
waitsForPromise(() => atom.workspace.scan(/\$\w+/, result => results.push(result)))
|
||||
waitsForPromise(() => atom.workspace.scan(
|
||||
/\$\w+/, {leadingContextLineCount: 1, trailingContextLineCount: 1},
|
||||
result => results.push(result)))
|
||||
|
||||
runs(() => {
|
||||
expect(results.length).toBe(1)
|
||||
@@ -1368,7 +1372,7 @@ i = /test/; #FIXME\
|
||||
lineText: 'dollar$bill',
|
||||
lineTextOffset: 0,
|
||||
range: [[2, 6], [2, 11]],
|
||||
leadingContextLines: [],
|
||||
leadingContextLines: ['cc aa cc'],
|
||||
trailingContextLines: []
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user