-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
190f9bc
commit 87e1dac
Showing
2 changed files
with
32 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,32 @@ | ||
import {throws} from './util/helpers'; | ||
|
||
// Unclosed elements | ||
throws('unclosed string', 'a[href="wow]'); | ||
throws('unclosed comment', '/* oops'); | ||
throws('unclosed pseudo element', 'button::'); | ||
throws('unclosed pseudo class', 'a:'); | ||
throws('unclosed string', 'a[href="wow]', 'Unclosed quote'); | ||
throws('unclosed comment', '/* oops', 'Unclosed comment'); | ||
throws('unclosed pseudo element', 'button::', 'Expected a pseudo-class or pseudo-element.'); | ||
throws('unclosed pseudo class', 'a:', 'Expected a pseudo-class or pseudo-element.'); | ||
throws('unclosed attribute selector', '[name="james"][href'); | ||
|
||
throws('no opening parenthesis', ')'); | ||
throws('no opening parenthesis (2)', ':global.foo)'); | ||
throws('no opening parenthesis (3)', 'h1:not(h2:not(h3)))'); | ||
throws('no opening parenthesis', ')', 'Expected an opening parenthesis.'); | ||
throws('no opening parenthesis (2)', ':global.foo)', 'Expected an opening parenthesis.'); | ||
throws('no opening parenthesis (3)', 'h1:not(h2:not(h3)))', 'Expected an opening parenthesis.'); | ||
|
||
throws('no opening square bracket', ']'); | ||
throws('no opening square bracket (2)', ':global.foo]'); | ||
throws('no opening square bracket (3)', '[global]]'); | ||
throws('no opening square bracket', ']', 'Expected an opening square bracket.'); | ||
throws('no opening square bracket (2)', ':global.foo]', 'Expected an opening square bracket.'); | ||
throws('no opening square bracket (3)', '[global]]', 'Expected an opening square bracket.'); | ||
|
||
throws('bad pseudo element', 'button::"after"'); | ||
throws('missing closing parenthesis in pseudo', ':not([attr="test"]:not([attr="test"])'); | ||
throws('bad pseudo element', 'button::"after"', 'Expected a pseudo-class or pseudo-element.'); | ||
throws('missing closing parenthesis in pseudo', ':not([attr="test"]:not([attr="test"])', 'Expected a closing parenthesis.'); | ||
|
||
throws('bad syntax', '-moz-osx-font-smoothing: grayscale'); | ||
throws('bad syntax (2)', '! .body'); | ||
throws('bad syntax', '-moz-osx-font-smoothing: grayscale', 'Expected a pseudo-class or pseudo-element.'); | ||
throws('bad syntax (2)', '! .body', 'Unexpected \'!\'. Escaping special characters with \\ may help.'); | ||
|
||
throws('missing backslash for semicolon', '.;'); | ||
throws('missing backslash for semicolon (2)', '.\;'); | ||
throws('unexpected / foo', '-Option\/root', "Unexpected '/'. Escaping special characters with \\ may help."); | ||
throws('bang in selector', '.foo !optional', "Unexpected '!'. Escaping special characters with \\ may help."); | ||
|
||
throws('misplaced parenthesis', ':not(', 'Expected a closing parenthesis.'); | ||
throws('misplaced parenthesis (2)', ':not)', 'Expected an opening parenthesis.'); | ||
throws('misplaced parenthesis (3)', ':not((', 'Expected a closing parenthesis.'); | ||
throws('misplaced parenthesis (4)', ':not))', 'Expected an opening parenthesis.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters