Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #28 from atom/wl-language-html-changes
Browse files Browse the repository at this point in the history
Update specs for language-html changes
  • Loading branch information
Wliu authored Sep 21, 2017
2 parents f05adfc + 0b4955f commit bad159c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions spec/mustache-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ describe 'Mustache grammar', ->
expect(tokens[2]).toEqual value: '}}', scopes: ['text.html.mustache', 'meta.tag.template.mustache', 'entity.name.tag.mustache']

it 'parses expressions in HTML attributes', ->
# TODO: Remove after Atom 1.21 is released
scopes = null
if parseFloat(atom.getVersion()) <= 1.21
scopes = ['meta.tag.any.html']
else
scopes = ['meta.tag.inline.a.html', 'meta.attribute-with-value.html']

{tokens} = grammar.tokenizeLine("<a href='{{test}}'></a>")

expect(tokens[6]).toEqual value: '{{', scopes: ['text.html.mustache', 'meta.tag.any.html', 'string.quoted.single.html', 'meta.tag.template.mustache', 'entity.name.tag.mustache']
expect(tokens[8]).toEqual value: '}}', scopes: ['text.html.mustache', 'meta.tag.any.html', 'string.quoted.single.html', 'meta.tag.template.mustache', 'entity.name.tag.mustache']
expect(tokens[9]).toEqual value: "'", scopes: ['text.html.mustache', 'meta.tag.any.html', 'string.quoted.single.html', 'punctuation.definition.string.end.html']
expect(tokens[6]).toEqual value: '{{', scopes: ['text.html.mustache', scopes..., 'string.quoted.single.html', 'meta.tag.template.mustache', 'entity.name.tag.mustache']
expect(tokens[8]).toEqual value: '}}', scopes: ['text.html.mustache', scopes..., 'string.quoted.single.html', 'meta.tag.template.mustache', 'entity.name.tag.mustache']
expect(tokens[9]).toEqual value: "'", scopes: ['text.html.mustache', scopes..., 'string.quoted.single.html', 'punctuation.definition.string.end.html']

it 'parses comments', ->
{tokens} = grammar.tokenizeLine("{{!comment}}")
Expand Down

0 comments on commit bad159c

Please sign in to comment.