mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Add test for situation where we infinitely looped
This commit is contained in:
@@ -107,6 +107,13 @@ describe "TextMateGrammar", ->
|
||||
{tokens} = grammar.getLineTokens('')
|
||||
expect(tokens[0]).toEqual value: '', scopes: ["source.coffee"]
|
||||
|
||||
describe "when the line matches no patterns", ->
|
||||
it "does not infinitely loop", ->
|
||||
grammar = TextMateBundle.grammarForFileName("sample.txt")
|
||||
{tokens} = grammar.getLineTokens('hoo')
|
||||
expect(tokens.length).toBe 1
|
||||
expect(tokens[0]).toEqual value: 'hoo', scopes: ["text.plain", "meta.paragraph.text"]
|
||||
|
||||
describe "when the line matches a pattern with a 'contentName'", ->
|
||||
it "creates tokens using the content of contentName as the token name", ->
|
||||
grammar = TextMateBundle.grammarForFileName("sample.txt")
|
||||
|
||||
Reference in New Issue
Block a user