update specs

This commit is contained in:
Dirk Thomas
2017-03-09 19:29:45 -08:00
parent 159ab1c435
commit 348553049a

View File

@@ -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: []
})
})