Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: test/mixin_test.dart

Issue 1009053006: pkg/csslib: remove unused vars and fields (Closed) Base URL: https://github.com/dart-lang/csslib@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/error_test.dart ('k') | test/nested_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 @mixin a { 451 @mixin a {
452 span { 452 span {
453 border: 2px dashed red; 453 border: 2px dashed red;
454 } 454 }
455 @include b; 455 @include b;
456 } 456 }
457 457
458 @include a; 458 @include a;
459 '''; 459 ''';
460 460
461 var generated = r'''span {
462 border: 2px dashed #f00;
463 }''';
464
465 var stylesheet = compileCss(input, errors: errors, opts: options); 461 var stylesheet = compileCss(input, errors: errors, opts: options);
466 expect(stylesheet != null, true); 462 expect(stylesheet != null, true);
467 expect(errors.length, 1, reason: errors.toString()); 463 expect(errors.length, 1, reason: errors.toString());
468 var error = errors[0]; 464 var error = errors[0];
469 expect(error.message, 'Using declaration mixin b as top-level mixin'); 465 expect(error.message, 'Using declaration mixin b as top-level mixin');
470 expect(error.span.start.line, 8); 466 expect(error.span.start.line, 8);
471 expect(error.span.end.offset, 90); 467 expect(error.span.end.offset, 90);
472 } 468 }
473 469
474 void emptyMixin() { 470 void emptyMixin() {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 test('multiple args and var decls as args', mixinManyArgs); 651 test('multiple args and var decls as args', mixinManyArgs);
656 }); 652 });
657 653
658 group('Mixin warnings', () { 654 group('Mixin warnings', () {
659 test('undefined top-level', undefinedTopLevel); 655 test('undefined top-level', undefinedTopLevel);
660 test('undefined declaration', undefinedDeclaration); 656 test('undefined declaration', undefinedDeclaration);
661 test('detect bad top-level as declaration', badDeclarationInclude); 657 test('detect bad top-level as declaration', badDeclarationInclude);
662 test('detect bad declaration as top-level', badTopInclude); 658 test('detect bad declaration as top-level', badTopInclude);
663 }); 659 });
664 } 660 }
OLDNEW
« no previous file with comments | « test/error_test.dart ('k') | test/nested_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698