Chromium Code Reviews| 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; |
| + } |
| +} |