| Index: packages/csslib/test/declaration_test.dart
|
| diff --git a/packages/csslib/test/declaration_test.dart b/packages/csslib/test/declaration_test.dart
|
| index af6fdefcf86199247837fd1b74c7ec78a23f883c..ab1f70df03faa83127d69496111914cce1a53f88 100644
|
| --- a/packages/csslib/test/declaration_test.dart
|
| +++ b/packages/csslib/test/declaration_test.dart
|
| @@ -478,6 +478,30 @@ void testMediaQueries() {
|
| expect(
|
| errors.first.message, contains('expected { after media before ruleset'));
|
| expect(errors.first.span.text, '(');
|
| +
|
| + // Test nested at-rules.
|
| + input = '''
|
| +@media (min-width: 840px) {
|
| + .cell {
|
| + width: calc(33% - 16px);
|
| + }
|
| + @supports (display: grid) {
|
| + .cell {
|
| + grid-column-end: span 4;
|
| + }
|
| + }
|
| +}''';
|
| + generated = '''@media (min-width:840px) {
|
| +.cell {
|
| + width: calc(33% - 16px);
|
| +}
|
| +@supports (display: grid) {
|
| +.cell {
|
| + grid-column-end: span 4;
|
| +}
|
| +}
|
| +}''';
|
| + expectCss(input, generated);
|
| }
|
|
|
| void testMozDocument() {
|
| @@ -1260,6 +1284,16 @@ void testExpressionSpans() {
|
| expect((decl as Declaration).expression.span.text, '50px');
|
| }
|
|
|
| +void testComments() {
|
| + final css = '''/* This comment has a nested HTML comment...
|
| +* <html>
|
| +* <!-- Nested HTML comment... -->
|
| +* <div></div>
|
| +* </html>
|
| +*/''';
|
| + expectCss(css, '');
|
| +}
|
| +
|
| void simpleCalc() {
|
| final input = r'''.foo { height: calc(100% - 55px); }''';
|
| var stylesheet = parseCss(input);
|
| @@ -1351,6 +1385,7 @@ main() {
|
| test('Expression spans', testExpressionSpans,
|
| skip: 'expression spans are broken'
|
| ' (https://github.com/dart-lang/csslib/issues/15)');
|
| + test('Comments', testComments);
|
| group('calc function', () {
|
| test('simple calc', simpleCalc);
|
| test('single complex', complexCalc);
|
|
|