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

Side by Side Diff: packages/initialize/test/initializer_type_filter_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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
5 // TODO(jakemac): swap this to @TestOn('pub-serve') once
6 // https://github.com/dart-lang/test/issues/388 is completed.
7 @TestOn('!js')
4 library initialize.initializer_type_filter_test; 8 library initialize.initializer_type_filter_test;
5 9
6 import 'package:initialize/initialize.dart'; 10 import 'package:initialize/initialize.dart';
7 import 'package:unittest/unittest.dart'; 11 import 'package:test/test.dart';
8 import 'package:unittest/compact_vm_config.dart';
9 12
10 // Initializers will mess with this value, and it gets reset to 0 at the 13 // Initializers will mess with this value, and it gets reset to 0 at the
11 // start of every test. 14 // start of every test.
12 var total; 15 var total;
13 16
14 main() { 17 main() {
15 useCompactVMConfiguration();
16
17 setUp(() { 18 setUp(() {
18 total = 0; 19 total = 0;
19 }); 20 });
20 21
21 test('filter option limits which types of annotations will be ran', () { 22 test('filter option limits which types of annotations will be ran', () {
22 return run(typeFilter: const [_Adder]).then((_) { 23 return run(typeFilter: const [_Adder]).then((_) {
23 expect(total, 2); 24 expect(total, 2);
24 }).then((_) => run(typeFilter: const [_Subtractor])).then((_) { 25 }).then((_) => run(typeFilter: const [_Subtractor])).then((_) {
25 expect(total, 0); 26 expect(total, 0);
26 }).then((_) => run(typeFilter: const [_Adder])).then((_) { 27 }).then((_) => run(typeFilter: const [_Adder])).then((_) {
(...skipping 23 matching lines...) Expand all
50 const adder = const _Adder(); 51 const adder = const _Adder();
51 52
52 // Initializer that decrements `total` by one. 53 // Initializer that decrements `total` by one.
53 class _Subtractor implements Initializer<dynamic> { 54 class _Subtractor implements Initializer<dynamic> {
54 const _Subtractor(); 55 const _Subtractor();
55 56
56 @override 57 @override
57 initialize(_) => total--; 58 initialize(_) => total--;
58 } 59 }
59 const subtractor = const _Subtractor(); 60 const subtractor = const _Subtractor();
OLDNEW
« no previous file with comments | « packages/initialize/test/initializer_test.html ('k') | packages/initialize/test/initializer_type_filter_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698