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

Side by Side Diff: pkg/dev_compiler/test/closure/closure_type_test.dart

Issue 2752163002: Format all dart dev compiler files (Closed)
Patch Set: Created 3 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
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 4
5 library dev_compiler.test.closure_type_test; 5 library dev_compiler.test.closure_type_test;
6 6
7 import 'package:test/test.dart'; 7 import 'package:test/test.dart';
8 8
9 import 'package:dev_compiler/src/closure/closure_type.dart'; 9 import 'package:dev_compiler/src/closure/closure_type.dart';
10 10
(...skipping 23 matching lines...) Expand all
34 34
35 test('supports array types', () { 35 test('supports array types', () {
36 expectToString(new ClosureType.array(), "Array<*>", 36 expectToString(new ClosureType.array(), "Array<*>",
37 nullable: "Array<*>", nonNullable: "!Array<*>"); 37 nullable: "Array<*>", nonNullable: "!Array<*>");
38 expectToString( 38 expectToString(
39 new ClosureType.array(new ClosureType.type("Foo")), "Array<Foo>", 39 new ClosureType.array(new ClosureType.type("Foo")), "Array<Foo>",
40 nullable: "Array<Foo>", nonNullable: "!Array<Foo>"); 40 nullable: "Array<Foo>", nonNullable: "!Array<Foo>");
41 }); 41 });
42 42
43 test('supports map types', () { 43 test('supports map types', () {
44 expectToString(new ClosureType.map( 44 expectToString(
45 new ClosureType.map(
45 new ClosureType.type("Foo"), new ClosureType.type("Bar")), 46 new ClosureType.type("Foo"), new ClosureType.type("Bar")),
46 "Object<Foo, Bar>", 47 "Object<Foo, Bar>",
47 nullable: "Object<Foo, Bar>", nonNullable: "!Object<Foo, Bar>"); 48 nullable: "Object<Foo, Bar>",
49 nonNullable: "!Object<Foo, Bar>");
48 expectToString(new ClosureType.map(), "Object<*, *>", 50 expectToString(new ClosureType.map(), "Object<*, *>",
49 nullable: "Object<*, *>", nonNullable: "!Object<*, *>"); 51 nullable: "Object<*, *>", nonNullable: "!Object<*, *>");
50 }); 52 });
51 53
52 test('supports function types', () { 54 test('supports function types', () {
53 expectToString(new ClosureType.function(), "Function", 55 expectToString(new ClosureType.function(), "Function",
54 nullable: "Function", nonNullable: "!Function"); 56 nullable: "Function", nonNullable: "!Function");
55 expectToString(new ClosureType.function([new ClosureType.number()]), 57 expectToString(new ClosureType.function([new ClosureType.number()]),
56 "function(number)"); 58 "function(number)");
57 expectToString(new ClosureType.function(null, new ClosureType.number()), 59 expectToString(new ClosureType.function(null, new ClosureType.number()),
58 "function(...*):number"); 60 "function(...*):number");
59 expectToString(new ClosureType.function([ 61 expectToString(
60 new ClosureType.number(), 62 new ClosureType.function(
61 new ClosureType.string() 63 [new ClosureType.number(), new ClosureType.string()],
62 ], new ClosureType.boolean()), "function(number, string):boolean"); 64 new ClosureType.boolean()),
65 "function(number, string):boolean");
63 }); 66 });
64 67
65 test('supports union types', () { 68 test('supports union types', () {
66 expectToString(new ClosureType.number().or(new ClosureType.boolean()), 69 expectToString(new ClosureType.number().or(new ClosureType.boolean()),
67 "(number|boolean)"); 70 "(number|boolean)");
68 expectToString( 71 expectToString(
69 new ClosureType.number().orUndefined(), "(number|undefined)"); 72 new ClosureType.number().orUndefined(), "(number|undefined)");
70 }); 73 });
71 74
72 test('supports record types', () { 75 test('supports record types', () {
73 expectToString(new ClosureType.record( 76 expectToString(
77 new ClosureType.record(
74 {'x': new ClosureType.number(), 'y': new ClosureType.boolean()}), 78 {'x': new ClosureType.number(), 'y': new ClosureType.boolean()}),
75 "{x: number, y: boolean}"); 79 "{x: number, y: boolean}");
76 }); 80 });
77 81
78 test('supports optional pseudo-types', () { 82 test('supports optional pseudo-types', () {
79 expectToString(new ClosureType.number().toOptional(), "number="); 83 expectToString(new ClosureType.number().toOptional(), "number=");
80 }); 84 });
81 }); 85 });
82 } 86 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/test/closure/closure_annotation_test.dart ('k') | pkg/dev_compiler/test/codegen/async_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698