OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 mixin_test; | 5 library mixin_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import 'testing.dart'; | 8 import 'testing.dart'; |
9 | 9 |
10 final options = ['--warnings_as_errors', '--no-colors', 'memory']; | |
11 | |
12 compileAndValidate(String input, String generated) { | 10 compileAndValidate(String input, String generated) { |
13 var errors = []; | 11 var errors = []; |
14 var stylesheet = compileCss(input, errors: errors, opts: options); | 12 var stylesheet = compileCss(input, errors: errors, opts: options); |
15 expect(stylesheet != null, true); | 13 expect(stylesheet != null, true); |
16 expect(errors.isEmpty, true, reason: errors.toString()); | 14 expect(errors.isEmpty, true, reason: errors.toString()); |
17 expect(prettyPrint(stylesheet), generated); | 15 expect(prettyPrint(stylesheet), generated); |
18 } | 16 } |
19 | 17 |
20 compilePolyfillAndValidate(String input, String generated) { | 18 compilePolyfillAndValidate(String input, String generated) { |
21 var errors = []; | 19 var errors = []; |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 test('multiple args and var decls as args', mixinManyArgs); | 649 test('multiple args and var decls as args', mixinManyArgs); |
652 }); | 650 }); |
653 | 651 |
654 group('Mixin warnings', () { | 652 group('Mixin warnings', () { |
655 test('undefined top-level', undefinedTopLevel); | 653 test('undefined top-level', undefinedTopLevel); |
656 test('undefined declaration', undefinedDeclaration); | 654 test('undefined declaration', undefinedDeclaration); |
657 test('detect bad top-level as declaration', badDeclarationInclude); | 655 test('detect bad top-level as declaration', badDeclarationInclude); |
658 test('detect bad declaration as top-level', badTopInclude); | 656 test('detect bad declaration as top-level', badTopInclude); |
659 }); | 657 }); |
660 } | 658 } |
OLD | NEW |