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

Commit

Permalink
- Added specs for comparison operator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lzambarda committed Dec 4, 2017
1 parent b6fd68f commit 9a42369
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/go-spec.coffee
Expand Up @@ -351,6 +351,15 @@ describe 'Go grammar', ->
expect(tokens[0].value).toEqual op[0]
expect(tokens[0].scopes).toEqual ['source.go', scope]

it 'does not treat values/variables attached to comparion operators as extensions of the operator', ->
{tokens} = grammar.tokenizeLine '2<3.0 && 12>bar'
expect(tokens[0]).toEqual value: '2', scopes: ['source.go', 'constant.numeric.integer.go']
expect(tokens[1]).toEqual value: '<', scopes: ['source.go', 'keyword.operator.comparison.go']
expect(tokens[2]).toEqual value: '3.0', scopes: ['source.go', 'constant.numeric.floating-point.go']
expect(tokens[6]).toEqual value: '12', scopes: ['source.go', 'constant.numeric.integer.go']
expect(tokens[7]).toEqual value: '>', scopes: ['source.go', 'keyword.operator.comparison.go']
expect(tokens[8]).toEqual value: 'bar', scopes: ['source.go']

it 'tokenizes punctuation brackets', ->
{tokens} = grammar.tokenizeLine '{([])}'
expect(tokens[0]).toEqual value: '{', scopes: ['source.go', 'punctuation.definition.begin.bracket.curly.go']
Expand Down

0 comments on commit 9a42369

Please sign in to comment.