| 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']; | 10 final options = ['--warnings_as_errors', '--no-colors', 'memory']; |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 border: 2px dashed #f00; | 489 border: 2px dashed #f00; |
| 490 }'''; | 490 }'''; |
| 491 | 491 |
| 492 var stylesheet = compileCss(input, errors: errors, opts: options); | 492 var stylesheet = compileCss(input, errors: errors, opts: options); |
| 493 | 493 |
| 494 expect(stylesheet != null, true); | 494 expect(stylesheet != null, true); |
| 495 expect(errors.isEmpty, true, reason: errors.toString()); | 495 expect(errors.isEmpty, true, reason: errors.toString()); |
| 496 expect(prettyPrint(stylesheet), generated); | 496 expect(prettyPrint(stylesheet), generated); |
| 497 } | 497 } |
| 498 | 498 |
| 499 | |
| 500 void undefinedTopLevel() { | 499 void undefinedTopLevel() { |
| 501 final errors = []; | 500 final errors = []; |
| 502 final input = r''' | 501 final input = r''' |
| 503 @mixin a { | 502 @mixin a { |
| 504 @include b; | 503 @include b; |
| 505 } | 504 } |
| 506 @mixin b { | 505 @mixin b { |
| 507 span { | 506 span { |
| 508 border: 2px dashed red; | 507 border: 2px dashed red; |
| 509 } | 508 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 test('multiple args and var decls as args', mixinManyArgs); | 655 test('multiple args and var decls as args', mixinManyArgs); |
| 657 }); | 656 }); |
| 658 | 657 |
| 659 group('Mixin warnings', () { | 658 group('Mixin warnings', () { |
| 660 test('undefined top-level', undefinedTopLevel); | 659 test('undefined top-level', undefinedTopLevel); |
| 661 test('undefined declaration', undefinedDeclaration); | 660 test('undefined declaration', undefinedDeclaration); |
| 662 test('detect bad top-level as declaration', badDeclarationInclude); | 661 test('detect bad top-level as declaration', badDeclarationInclude); |
| 663 test('detect bad declaration as top-level', badTopInclude); | 662 test('detect bad declaration as top-level', badTopInclude); |
| 664 }); | 663 }); |
| 665 } | 664 } |
| OLD | NEW |