Skip to content

Commit 818c7f7

Browse files
committed
Merge pull request dart-archive/csslib#14 from yjbanov/expression-span
test for broken expression spans
2 parents 1f6eb5d + caa46d5 commit 818c7f7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkgs/csslib/test/declaration_test.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,16 @@ void testHangs() {
10051005
expect(errorMessage.span.text.trim(), '');
10061006
}
10071007

1008+
void testExpressionSpans() {
1009+
final input = r'''.foo { width: 50px; }''';
1010+
var stylesheet = parseCss(input);
1011+
var decl = stylesheet.topLevels.single.declarationGroup.declarations.single;
1012+
// This passes
1013+
expect(decl.span.text, 'width: 50px');
1014+
// This currently fails
1015+
expect(decl.expression.span.text, '50px');
1016+
}
1017+
10081018
main() {
10091019
test('Simple Terms', testSimpleTerms);
10101020
test('Declarations', testDeclarations);
@@ -1021,4 +1031,6 @@ main() {
10211031
test('IE stuff', testIE);
10221032
test('IE declaration syntax', testIEDeclaration);
10231033
test('Hanging bugs', testHangs);
1034+
test('Expression spans', testExpressionSpans,
1035+
skip: 'expression spans are broken');
10241036
}

0 commit comments

Comments
 (0)