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

Side by Side Diff: tests/language/bad_named_parameters2_test.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated latest tests. Created 7 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 | Annotate | Revision Log
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 // Dart test program for testing bad named parameters. 4 // Dart test program for testing bad named parameters.
5 5
6 import "package:expect/expect.dart";
7
6 8
7 class BadNamedParameters2Test { 9 class BadNamedParameters2Test {
8 10
9 int foo(int a) { 11 int foo(int a) {
10 // Although no optional named parameters are declared, we must check that 12 // Although no optional named parameters are declared, we must check that
11 // no named arguments are passed in, either here or in the resolving stub. 13 // no named arguments are passed in, either here or in the resolving stub.
12 return a; 14 return a;
13 } 15 }
14 16
15 static testMain() { 17 static testMain() {
16 BadNamedParameters2Test np = new BadNamedParameters2Test(); 18 BadNamedParameters2Test np = new BadNamedParameters2Test();
17 19
18 // Verify that NoSuchMethod is called after an error is detected. 20 // Verify that NoSuchMethod is called after an error is detected.
19 bool caught; 21 bool caught;
20 try { 22 try {
21 caught = false; 23 caught = false;
22 // No formal parameter named b. 24 // No formal parameter named b.
23 np.foo(b:25); /// static type warning 25 np.foo(b:25); /// static type warning
24 } on NoSuchMethodError catch (e) { 26 } on NoSuchMethodError catch (e) {
25 caught = true; 27 caught = true;
26 } 28 }
27 Expect.equals(true, caught); 29 Expect.equals(true, caught);
28 } 30 }
29 } 31 }
30 32
31 main() { 33 main() {
32 BadNamedParameters2Test.testMain(); 34 BadNamedParameters2Test.testMain();
33 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698