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

Side by Side Diff: pkg/unittest/test/matchers_minified_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 | « no previous file | pkg/unittest/test/matchers_unminified_test.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 normally fail when run in minified dart2js, since the names will 6 // These tests normally fail when run in minified dart2js, since the names will
7 // be mangled. This version of the file is modified to expect minified names. 7 // be mangled. This version of the file is modified to expect minified names.
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 throwsRangeError); 45 throwsRangeError);
46 shouldFail(() { throw new Exception(); }, 46 shouldFail(() { throw new Exception(); },
47 throwsRangeError, 47 throwsRangeError,
48 matches( 48 matches(
49 r"Expected: throws RangeError +" 49 r"Expected: throws RangeError +"
50 r"Actual: <Closure(: \(\) => dynamic)?> +" 50 r"Actual: <Closure(: \(\) => dynamic)?> +"
51 r"Which: threw " + _minifiedName + r":<Exception>")); 51 r"Which: threw " + _minifiedName + r":<Exception>"));
52 }); 52 });
53 53
54 test('throwsNoSuchMethodError', () { 54 test('throwsNoSuchMethodError', () {
55 shouldPass(() { throw new NoSuchMethodError(null, '', null, null); }, 55 shouldPass(() {
56 throwsNoSuchMethodError); 56 throw new NoSuchMethodError(null, const Symbol(''), null, null);
57 }, throwsNoSuchMethodError);
57 shouldFail(() { throw new Exception(); }, 58 shouldFail(() { throw new Exception(); },
58 throwsNoSuchMethodError, 59 throwsNoSuchMethodError,
59 matches( 60 matches(
60 r"Expected: throws NoSuchMethodError +" 61 r"Expected: throws NoSuchMethodError +"
61 r"Actual: <Closure(: \(\) => dynamic)?> +" 62 r"Actual: <Closure(: \(\) => dynamic)?> +"
62 r"Which: threw " + _minifiedName + r":<Exception>")); 63 r"Which: threw " + _minifiedName + r":<Exception>"));
63 }); 64 });
64 65
65 test('throwsUnimplementedError', () { 66 test('throwsUnimplementedError', () {
66 shouldPass(() { throw new UnimplementedError(''); }, 67 shouldPass(() { throw new UnimplementedError(''); },
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 shouldFail(w, new HasPrice(greaterThan(10)), 125 shouldFail(w, new HasPrice(greaterThan(10)),
125 matches( 126 matches(
126 r"Expected: Widget with a price that is a value greater than " 127 r"Expected: Widget with a price that is a value greater than "
127 r"<10> +" 128 r"<10> +"
128 r"Actual: <Instance of '" + _minifiedName + r"'> +" 129 r"Actual: <Instance of '" + _minifiedName + r"'> +"
129 r"Which: has price with value <10> which is not " 130 r"Which: has price with value <10> which is not "
130 r"a value greater than <10>")); 131 r"a value greater than <10>"));
131 }); 132 });
132 }); 133 });
133 } 134 }
OLDNEW
« no previous file with comments | « no previous file | pkg/unittest/test/matchers_unminified_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698