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

Unified Diff: pkg/args/test/args_test.dart

Issue 10989013: Change IllegalArgumentException to ArgumentError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated co19 test expectations. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: pkg/args/test/args_test.dart
diff --git a/pkg/args/test/args_test.dart b/pkg/args/test/args_test.dart
index 1de7877aab0ed14c19cb18103555e10677b137a2..d3b219bf16fbec0327f5a79f19718320ab4d3e8e 100644
--- a/pkg/args/test/args_test.dart
+++ b/pkg/args/test/args_test.dart
@@ -11,25 +11,25 @@
main() {
group('ArgParser.addFlag()', () {
- test('throws IllegalArgumentException if the flag already exists', () {
+ test('throws ArgumentError if the flag already exists', () {
var parser = new ArgParser();
parser.addFlag('foo');
throwsIllegalArg(() => parser.addFlag('foo'));
});
- test('throws IllegalArgumentException if the option already exists', () {
+ test('throws ArgumentError if the option already exists', () {
var parser = new ArgParser();
parser.addOption('foo');
throwsIllegalArg(() => parser.addFlag('foo'));
});
- test('throws IllegalArgumentException if the abbreviation exists', () {
+ test('throws ArgumentError if the abbreviation exists', () {
var parser = new ArgParser();
parser.addFlag('foo', abbr: 'f');
throwsIllegalArg(() => parser.addFlag('flummox', abbr: 'f'));
});
- test('throws IllegalArgumentException if the abbreviation is longer '
+ test('throws ArgumentError if the abbreviation is longer '
'than one character', () {
var parser = new ArgParser();
throwsIllegalArg(() => parser.addFlag('flummox', abbr: 'flu'));
@@ -37,25 +37,25 @@ main() {
});
group('ArgParser.addOption()', () {
- test('throws IllegalArgumentException if the flag already exists', () {
+ test('throws ArgumentError if the flag already exists', () {
var parser = new ArgParser();
parser.addFlag('foo');
throwsIllegalArg(() => parser.addOption('foo'));
});
- test('throws IllegalArgumentException if the option already exists', () {
+ test('throws ArgumentError if the option already exists', () {
var parser = new ArgParser();
parser.addOption('foo');
throwsIllegalArg(() => parser.addOption('foo'));
});
- test('throws IllegalArgumentException if the abbreviation exists', () {
+ test('throws ArgumentError if the abbreviation exists', () {
var parser = new ArgParser();
parser.addFlag('foo', abbr: 'f');
throwsIllegalArg(() => parser.addOption('flummox', abbr: 'f'));
});
- test('throws IllegalArgumentException if the abbreviation is longer '
+ test('throws ArgumentError if the abbreviation is longer '
'than one character', () {
var parser = new ArgParser();
throwsIllegalArg(() => parser.addOption('flummox', abbr: 'flu'));
@@ -434,14 +434,14 @@ main() {
var parser = new ArgParser();
parser.addOption('define', defaultsTo: '0');
expect(()=>parser.getDefault('undefine'),
- throwsIllegalArgumentException);
+ throwsArgumentError);
});
test('queries the default value for an unknown option', () {
var parser = new ArgParser();
parser.addOption('define', defaultsTo: '0');
expect(()=>parser.getDefault('undefine'),
- throwsIllegalArgumentException);
+ throwsArgumentError);
});
});
@@ -664,7 +664,7 @@ main() {
}
throwsIllegalArg(function) {
- expect(function, throwsIllegalArgumentException);
+ expect(function, throwsArgumentError);
}
throwsFormat(ArgParser parser, List<String> args) {
@@ -693,14 +693,14 @@ String unindentString(String text) {
if (line.length <= indent) {
// It's short, so it must be nothing but whitespace.
if (line.trim() != '') {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
'Line "$line" does not have enough indentation.');
}
lines[i] = '';
} else {
if (line.substring(0, indent).trim() != '') {
- throw new IllegalArgumentException(
+ throw new ArgumentError(
'Line "$line" does not have enough indentation.');
}

Powered by Google App Engine
This is Rietveld 408576698