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

Side by Side Diff: pkg/unittest/test/matchers_unminified_test.dart

Issue 23486007: Change the field and constructor parameter types of NoSuchMethodError to Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 7 years, 3 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
« no previous file with comments | « pkg/unittest/test/matchers_minified_test.dart ('k') | runtime/lib/errors_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This file is for matcher tests that rely on the names of various Dart types. 5 // This file is for matcher tests that rely on the names of various Dart types.
6 // These tests will fail when run in minified dart2js, since the names will be 6 // These tests will fail when run in minified dart2js, since the names will be
7 // mangled. A version of this file that works in minified dart2js is in 7 // mangled. A version of this file that works in minified dart2js is in
8 // matchers_minified_test.dart. 8 // matchers_minified_test.dart.
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 throwsRangeError); 44 throwsRangeError);
45 shouldFail(() { throw new Exception(); }, 45 shouldFail(() { throw new Exception(); },
46 throwsRangeError, 46 throwsRangeError,
47 matches( 47 matches(
48 r"Expected: throws RangeError +" 48 r"Expected: throws RangeError +"
49 r"Actual: <Closure(: \(\) => dynamic)?> +" 49 r"Actual: <Closure(: \(\) => dynamic)?> +"
50 r"Which: threw \?:<Exception>")); 50 r"Which: threw \?:<Exception>"));
51 }); 51 });
52 52
53 test('throwsNoSuchMethodError', () { 53 test('throwsNoSuchMethodError', () {
54 shouldPass(() { throw new NoSuchMethodError(null, '', null, null); }, 54 shouldPass(() {
55 throwsNoSuchMethodError); 55 throw new NoSuchMethodError(null, const Symbol(''), null, null);
56 }, throwsNoSuchMethodError);
56 shouldFail(() { throw new Exception(); }, 57 shouldFail(() { throw new Exception(); },
57 throwsNoSuchMethodError, 58 throwsNoSuchMethodError,
58 matches( 59 matches(
59 r"Expected: throws NoSuchMethodError +" 60 r"Expected: throws NoSuchMethodError +"
60 r"Actual: <Closure(: \(\) => dynamic)?> +" 61 r"Actual: <Closure(: \(\) => dynamic)?> +"
61 r"Which: threw \?:<Exception>")); 62 r"Which: threw \?:<Exception>"));
62 }); 63 });
63 64
64 test('throwsUnimplementedError', () { 65 test('throwsUnimplementedError', () {
65 shouldPass(() { throw new UnimplementedError(''); }, 66 shouldPass(() { throw new UnimplementedError(''); },
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 shouldPass(w, new HasPrice(10)); 121 shouldPass(w, new HasPrice(10));
121 shouldPass(w, new HasPrice(greaterThan(0))); 122 shouldPass(w, new HasPrice(greaterThan(0)));
122 shouldFail(w, new HasPrice(greaterThan(10)), 123 shouldFail(w, new HasPrice(greaterThan(10)),
123 "Expected: Widget with a price that is a value greater than <10> " 124 "Expected: Widget with a price that is a value greater than <10> "
124 "Actual: <Instance of 'Widget'> " 125 "Actual: <Instance of 'Widget'> "
125 "Which: has price with value <10> which is not " 126 "Which: has price with value <10> which is not "
126 "a value greater than <10>"); 127 "a value greater than <10>");
127 }); 128 });
128 }); 129 });
129 } 130 }
OLDNEW
« no previous file with comments | « pkg/unittest/test/matchers_minified_test.dart ('k') | runtime/lib/errors_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698