Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add some basic CSSGrammar tests. Fix
@page rule
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
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
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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/env perl6 | ||
|
|
||
| use v6; | ||
| use Test; | ||
|
|
||
| # A simple string parser is defined here: | ||
| use lib 'categories/parsers'; | ||
| use CSSGrammar; | ||
|
|
||
| plan(8); | ||
|
|
||
| # Save these to variables just for brevity | ||
| my $grammar = CSSGrammar; | ||
|
|
||
| ok $grammar.parse(q<H1 { color: blue; }>), "ruleset, basic"; | ||
| ok $grammar.parse(q<42 7% 12.5cm -1em 2 ex 45deg 10s 50Hz 'ZZ' counter(a,b) counters(p,'s') attr(data-foo)>, :rule<expr>), "expressions"; | ||
| ok $grammar.parse(q<A:Visited + .some_class:link + H1[lang=fr]>, :rule<selector>), "selector"; | ||
| ok $grammar.parse(q<@import url('file:///etc/passwd');>, :rule<import>), 'import url'; | ||
| ok $grammar.parse(q<@import '/etc/passwd';>), 'import file'; | ||
| ok $grammar.parse(q<body{margin: 1cm; color: red;}>, :rule<ruleset>), 'ruleset'; | ||
| ok $grammar.parse(q<@media print {body{margin: 1cm}}>), '@media rule'; | ||
| ok $grammar.parse(q<@Page :first { margin-right: 2cm }>), '@page rule'; | ||
|
|
||
| # vim: sw=4 softtabstop=4 ai expandtab filetype=perl6 |