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

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

Issue 10983066: Minor improvement to File diagnostics (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added a test 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
« no previous file with comments | « dart/runtime/bin/file_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/standalone/io/file_constructor_test.dart
diff --git a/dart/tests/standalone/io/file_constructor_test.dart b/dart/tests/standalone/io/file_constructor_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f347b70f8ccaa879be37b2d91221c1e48bb7e381
--- /dev/null
+++ b/dart/tests/standalone/io/file_constructor_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+void main() {
+ bool developerMode = false;
+ assert(developerMode = true);
+ new File('blåbærgrød');
Mads Ager (google) 2012/09/28 09:48:56 This line and the next should be removed.
ahe 2012/09/28 10:42:57 Why?
Mads Ager (google) 2012/09/28 11:05:42 I was thinking that it was redundant because of al
+ new File('foo.txt');
+ try {
+ new File(null);
+ Expect.fail('ArgumentError expected.');
+ } on ArgumentError catch(e) {
+ // Expected.
+ }
+ try {
+ new File(1);
+ Expect.fail('Error expected.');
+ } on ArgumentError catch(e) {
+ if (developerMode) throw;
+ } on TypeError catch(e) {
+ if (!developerMode) throw;
+ }
+}
« no previous file with comments | « dart/runtime/bin/file_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698