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

Side by Side Diff: test/utils_test.dart

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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/samples/trusttypes2.dart ('k') | tool/build_sdk.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library dev_compiler.test.utils_test;
6
7 import 'package:dev_compiler/src/utils.dart';
8 import 'package:test/test.dart';
9
10 enum Foo { first, second }
11
12 void main() {
13 group('getEnumValue', () {
14 test('gets simple names', () {
15 expect(getEnumName(Foo.first), 'first');
16 });
17 test('chokes on invalid values', () {
18 expect(() => getEnumName(null), throws);
19 expect(() => getEnumName(''), throws);
20 expect(() => getEnumName('.'), throws);
21 expect(() => getEnumName('.a'), throws);
22 expect(() => getEnumName('a.'), throws);
23 });
24 });
25 group('parseEnum', () {
26 Foo parseFoo(String s) => parseEnum(s, Foo.values);
27 test('parses enums', () {
28 expect(parseFoo('first'), Foo.first);
29 expect(parseFoo('second'), Foo.second);
30 });
31 test('chokes on unknown enums', () {
32 expect(() => parseFoo(''), throws);
33 expect(() => parseFoo('what'), throws);
34 });
35 });
36 }
OLDNEW
« no previous file with comments | « test/samples/trusttypes2.dart ('k') | tool/build_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698