OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library compiler_test; | 5 library compiler_test; |
6 | 6 |
7 import 'dart:utf'; | 7 import 'dart:convert'; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
9 import 'package:csslib/parser.dart'; | 9 import 'package:csslib/parser.dart'; |
10 import 'package:csslib/visitor.dart'; | 10 import 'package:csslib/visitor.dart'; |
11 import 'testing.dart'; | 11 import 'testing.dart'; |
12 | 12 |
13 void testClass() { | 13 void testClass() { |
14 var errors = []; | 14 var errors = []; |
15 var input = ".foobar {}"; | 15 var input = ".foobar {}"; |
16 var stylesheet = parseCss(input, errors: errors); | 16 var stylesheet = parseCss(input, errors: errors); |
17 | 17 |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 /** Test List<int> as input to parser. */ | 514 /** Test List<int> as input to parser. */ |
515 void testArrayOfChars() { | 515 void testArrayOfChars() { |
516 var errors = []; | 516 var errors = []; |
517 var input = '<![CDATA[.foo { ' | 517 var input = '<![CDATA[.foo { ' |
518 'color: red; left: 20px; top: 20px; width: 100px; height:200px' | 518 'color: red; left: 20px; top: 20px; width: 100px; height:200px' |
519 '}' | 519 '}' |
520 '#div {' | 520 '#div {' |
521 'color : #00F578; border-color: #878787;' | 521 'color : #00F578; border-color: #878787;' |
522 '}]]>'; | 522 '}]]>'; |
523 | 523 |
524 var stylesheet = parse(encodeUtf8(input), errors: errors); | 524 var stylesheet = parse(UTF8.encode(input), errors: errors); |
525 | 525 |
526 expect(stylesheet != null, true); | 526 expect(stylesheet != null, true); |
527 expect(errors.isEmpty, true, reason: errors.toString()); | 527 expect(errors.isEmpty, true, reason: errors.toString()); |
528 | 528 |
529 expect(prettyPrint(stylesheet), r''' | 529 expect(prettyPrint(stylesheet), r''' |
530 .foo { | 530 .foo { |
531 color: #f00; | 531 color: #f00; |
532 left: 20px; | 532 left: 20px; |
533 top: 20px; | 533 top: 20px; |
534 width: 100px; | 534 width: 100px; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 test('Selector Groups', testSelectorGroups); | 719 test('Selector Groups', testSelectorGroups); |
720 test('Combinator', testCombinator); | 720 test('Combinator', testCombinator); |
721 test('Wildcards', testWildcard); | 721 test('Wildcards', testWildcard); |
722 test('Pseudo', testPseudo); | 722 test('Pseudo', testPseudo); |
723 test('Attributes', testAttribute); | 723 test('Attributes', testAttribute); |
724 test('Negation', testNegation); | 724 test('Negation', testNegation); |
725 test('@host', testHost); | 725 test('@host', testHost); |
726 test('Parse List<int> as input', testArrayOfChars); | 726 test('Parse List<int> as input', testArrayOfChars); |
727 test('Simple Emitter', testEmitter); | 727 test('Simple Emitter', testEmitter); |
728 } | 728 } |
OLD | NEW |