diff --git a/syntaxes/html.json b/syntaxes/html.json index 1bd9fdd7..b5a88b95 100644 --- a/syntaxes/html.json +++ b/syntaxes/html.json @@ -240,7 +240,7 @@ ] }, "tag-aurelia-attribute-with-databinding-attribute": { - "match": "(? { - - it(`must tokenize (some).bind="foo" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 10, 14); - assert.isOk(hasScope(token.scopes, scope)); - - }); - - it(`must tokenize (some).one-way="foo" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 10, 17); - assert.isOk(hasScope(token.scopes, scope)); - - }); - - it(`must tokenize (some).two-way="foo" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 10, 17); - assert.isOk(hasScope(token.scopes, scope)); - - }); - - it(`must tokenize (some).one-time="foo" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 10, 18); - assert.isOk(hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x.(bind)" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 14); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x; x.(bind)" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 17); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x.(bind)='x'; x" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 21); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x.(one-way)" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 17); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x; x.(one-way)" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 20); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x.(one-way)='x'; x" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 24); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x.(two-way)" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 17); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x; x.(two-way)" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 20); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x.(two-way)='x; x" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 24); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x.(one-time)" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 18); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x; x.(one-time)" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 21); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - - it(`must not tokenize a="x.(one-time)='\'x\; x" attribute with scope "databinding.attribute.html.au"`, () => { - - // arrange - let scope = 'databinding.attribute.html.au'; - - // act - let lineToken = tokenizeLine('
'); - - // assert - let token = getTokenOnCharRange(lineToken, 8, 25); - assert.isOk(!hasScope(token.scopes, scope)); - - }); - -}); +import { assert } from 'chai'; +import { getTokenOnCharRange, hasScope, tokenizeLine } from './test.utils'; + +describe('The Aurelia HTML syntax databinding attributes', () => { + + it(`must tokenize (some).bind="foo" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 10, 14); + assert.isOk(hasScope(token.scopes, scope)); + + }); + + it(`must tokenize (some).one-way="foo" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 10, 17); + assert.isOk(hasScope(token.scopes, scope)); + + }); + + it(`must tokenize (some).two-way="foo" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 10, 17); + assert.isOk(hasScope(token.scopes, scope)); + + }); + + it(`must tokenize (some).one-time="foo" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 10, 18); + assert.isOk(hasScope(token.scopes, scope)); + + }); + + it(`must tokenize (some).from-view="foo" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 10, 19); + assert.isOk(hasScope(token.scopes, scope)); + + }); + + it(`must tokenize (some).to-view="foo" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 10, 17); + assert.isOk(hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(bind)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 14); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x; x.(bind)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 17); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(bind)='x'; x" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 21); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(one-way)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 17); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x; x.(one-way)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 20); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(one-way)='x'; x" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 24); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(two-way)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 17); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x; x.(two-way)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 20); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(two-way)='x; x" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 24); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(one-time)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 18); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x; x.(one-time)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 21); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(one-time)='\'x\; x" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 25); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(from-view)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 19); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x; x.(from-view)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 22); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(from-view)='\'x\; x" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 26); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(to-view)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 17); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x; x.(to-view)" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 20); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + + it(`must not tokenize a="x.(to-view)='\'x\; x" attribute with scope "databinding.attribute.html.au"`, () => { + + // arrange + let scope = 'databinding.attribute.html.au'; + + // act + let lineToken = tokenizeLine('
'); + + // assert + let token = getTokenOnCharRange(lineToken, 8, 24); + assert.isOk(!hasScope(token.scopes, scope)); + + }); + +});