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

Side by Side Diff: tests/language_2/compile_time_constant11_test.dart

Issue 3002573002: Migrating another batch of tests to dart 2. (Closed)
Patch Set: Removed library closure_type_test from test_file 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Check that conditional expression can be a compile-time constant. 5 // Check that conditional expression can be a compile-time constant.
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 const C1 = true; 9 const C1 = true;
10 const C2 = false; 10 const C2 = false;
11 11
12 const nephew = C1 ? C2 ? "Tick" : "Trick" : "Track"; 12 const nephew = C1 ? C2 ? "Tick" : "Trick" : "Track";
13 13
14 main() { 14 main() {
15 const a = true ? 5 : 10; 15 const a = true ? 5 : 10;
16 const b = C2 ? "Track" : C1 ? "Trick" : "Tick"; 16 const b = C2 ? "Track" : C1 ? "Trick" : "Tick";
17 17
18 Expect.equals(5, a); 18 Expect.equals(5, a);
19 Expect.equals("Trick", nephew); 19 Expect.equals("Trick", nephew);
20 Expect.equals(nephew, b); 20 Expect.equals(nephew, b);
21 Expect.identical(nephew, b); 21 Expect.identical(nephew, b);
22 var s = const Symbol(nephew); 22 var s = const Symbol(nephew);
23 var msg = "Donald is $nephew's uncle."; 23 var msg = "Donald is $nephew's uncle.";
24 Expect.equals("Donald is Trick's uncle.", msg); 24 Expect.equals("Donald is Trick's uncle.", msg);
25 } 25 }
OLDNEW
« no previous file with comments | « tests/language_2/compile_time_constant10_test.dart ('k') | tests/language_2/compile_time_constant12_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698