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

Unified Diff: tests/standalone/io/file_invalid_arguments_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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: tests/standalone/io/file_invalid_arguments_test.dart
diff --git a/tests/standalone/io/file_invalid_arguments_test.dart b/tests/standalone/io/file_invalid_arguments_test.dart
index db15b775698973428dfa9c72c0b895b8975b8497..13d9d3ef37435f714a28c3ebcea13fc8fddb4e57 100644
--- a/tests/standalone/io/file_invalid_arguments_test.dart
+++ b/tests/standalone/io/file_invalid_arguments_test.dart
@@ -13,44 +13,40 @@ import "package:expect/expect.dart";
void testReadInvalidArgs(arg) {
String filename = getFilename("fixed_length_file");
var file = (new File(filename)).openSync();
- Expect.throws(() => file.readSync(arg),
- (e) => e is ArgumentError);
+ Expect.throws(() => file.readSync(arg), (e) => e is ArgumentError);
- Expect.throws(() => file.read(arg),
- (e) => e is ArgumentError);
+ Expect.throws(() => file.read(arg), (e) => e is ArgumentError);
file.closeSync();
}
void testReadIntoInvalidArgs(buffer, start, end) {
String filename = getFilename("fixed_length_file");
var file = (new File(filename)).openSync();
- Expect.throws(() => file.readIntoSync(buffer, start, end),
- (e) => e is ArgumentError);
+ Expect.throws(
+ () => file.readIntoSync(buffer, start, end), (e) => e is ArgumentError);
- Expect.throws(() => file.readInto(buffer, start, end),
- (e) => e is ArgumentError);
+ Expect.throws(
+ () => file.readInto(buffer, start, end), (e) => e is ArgumentError);
file.closeSync();
}
void testWriteByteInvalidArgs(value) {
String filename = getFilename("fixed_length_file");
var file = (new File("${filename}_out")).openSync(mode: FileMode.WRITE);
- Expect.throws(() => file.writeByteSync(value),
- (e) => e is ArgumentError);
+ Expect.throws(() => file.writeByteSync(value), (e) => e is ArgumentError);
- Expect.throws(() => file.writeByte(value),
- (e) => e is ArgumentError);
+ Expect.throws(() => file.writeByte(value), (e) => e is ArgumentError);
file.closeSync();
}
void testWriteFromInvalidArgs(buffer, start, end) {
String filename = getFilename("fixed_length_file");
var file = (new File("${filename}_out")).openSync(mode: FileMode.WRITE);
- Expect.throws(() => file.writeFromSync(buffer, start, end),
- (e) => e is ArgumentError);
+ Expect.throws(
+ () => file.writeFromSync(buffer, start, end), (e) => e is ArgumentError);
- Expect.throws(() => file.writeFrom(buffer, start, end),
- (e) => e is ArgumentError);
+ Expect.throws(
+ () => file.writeFrom(buffer, start, end), (e) => e is ArgumentError);
file.closeSync();
}
@@ -58,10 +54,10 @@ void testWriteStringInvalidArgs(string, encoding) {
String filename = getFilename("fixed_length_file");
var file = new File("${filename}_out").openSync(mode: FileMode.WRITE);
Expect.throws(() => file.writeStringSync(string, encoding: encoding),
- (e) => e is ArgumentError);
+ (e) => e is ArgumentError);
Expect.throws(() => file.writeString(string, encoding: encoding),
- (e) => e is ArgumentError);
+ (e) => e is ArgumentError);
file.closeSync();
}
@@ -69,35 +65,33 @@ Future futureThrows(Future result) {
return result.then((value) {
throw new ExpectException(
"futureThrows received $value instead of an exception");
- },
- onError: (_) => null
- );
+ }, onError: (_) => null);
}
void testFileSystemEntity() {
- Expect.throws(() => ((x) => FileSystemEntity.typeSync(x))([1,2,3]));
+ Expect.throws(() => ((x) => FileSystemEntity.typeSync(x))([1, 2, 3]));
Expect.throws(() => ((x, y) =>
FileSystemEntity.typeSync(x, followLinks: y))(".", "why not?"));
- Expect.throws(() => ((x, y) =>
- FileSystemEntity.identicalSync(x, y))([1,2,3], "."));
- Expect.throws(() => ((x, y) =>
- FileSystemEntity.identicalSync(x, y))(".", 52));
+ Expect.throws(
+ () => ((x, y) => FileSystemEntity.identicalSync(x, y))([1, 2, 3], "."));
+ Expect
+ .throws(() => ((x, y) => FileSystemEntity.identicalSync(x, y))(".", 52));
Expect.throws(() => ((x) => FileSystemEntity.isLinkSync(x))(52));
Expect.throws(() => ((x) => FileSystemEntity.isFileSync(x))(52));
Expect.throws(() => ((x) => FileSystemEntity.isDirectorySync(x))(52));
asyncStart();
- futureThrows(((x) => FileSystemEntity.type(x))([1,2,3]))
- .then((_) => futureThrows(((x, y) =>
- FileSystemEntity.type(x, followLinks: y))(".", "why not?")))
- .then((_) => futureThrows(((x, y) =>
- FileSystemEntity.identical(x, y))([1,2,3], ".")))
- .then((_) => futureThrows(((x, y) =>
- FileSystemEntity.identical(x, y))(".", 52)))
- .then((_) => futureThrows(((x) => FileSystemEntity.isLink(x))(52)))
- .then((_) => futureThrows(((x) => FileSystemEntity.isFile(x))(52)))
- .then((_) => futureThrows(((x) => FileSystemEntity.isDirectory(x))(52)))
- .then((_) => asyncEnd());
+ futureThrows(((x) => FileSystemEntity.type(x))([1, 2, 3]))
+ .then((_) => futureThrows(((x, y) =>
+ FileSystemEntity.type(x, followLinks: y))(".", "why not?")))
+ .then((_) => futureThrows(
+ ((x, y) => FileSystemEntity.identical(x, y))([1, 2, 3], ".")))
+ .then((_) =>
+ futureThrows(((x, y) => FileSystemEntity.identical(x, y))(".", 52)))
+ .then((_) => futureThrows(((x) => FileSystemEntity.isLink(x))(52)))
+ .then((_) => futureThrows(((x) => FileSystemEntity.isFile(x))(52)))
+ .then((_) => futureThrows(((x) => FileSystemEntity.isDirectory(x))(52)))
+ .then((_) => asyncEnd());
}
String getFilename(String path) {

Powered by Google App Engine
This is Rietveld 408576698