From 9f36ac2e01bc2662f4a6d015545d75d86df21769 Mon Sep 17 00:00:00 2001 From: Yegor Jbanov Date: Wed, 30 Sep 2015 13:44:53 -0700 Subject: [PATCH] test for broken expression spans --- test/declaration_test.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/declaration_test.dart b/test/declaration_test.dart index 8326a03..3b48f5f 100644 --- a/test/declaration_test.dart +++ b/test/declaration_test.dart @@ -1005,6 +1005,16 @@ void testHangs() { expect(errorMessage.span.text.trim(), ''); } +void testExpressionSpans() { + final input = r'''.foo { width: 50px; }'''; + var stylesheet = parseCss(input); + var decl = stylesheet.topLevels.single.declarationGroup.declarations.single; + // This passes + expect(decl.span.text, 'width: 50px'); + // This currently fails + expect(decl.expression.span.text, '50px'); +} + main() { test('Simple Terms', testSimpleTerms); test('Declarations', testDeclarations); @@ -1021,4 +1031,6 @@ main() { test('IE stuff', testIE); test('IE declaration syntax', testIEDeclaration); test('Hanging bugs', testHangs); + test('Expression spans', testExpressionSpans, + skip: 'expression spans are broken'); }