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

Side by Side Diff: tests/standalone/src/io/ReadIntoConstListTest.dart

Issue 10252020: test rename overhaul: step 12 - standalone (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Regression test for missing immutability check in the ListSet
6 // methods in the API. This allowed overwriting const Lists.
7
8 #import("dart:io");
9
10 String getFilename(String path) =>
11 new File(path).existsSync() ? path : 'runtime/' + path;
12
13 void main() {
14 var a = const [0];
15 var b = const [0];
16 Expect.isTrue(a === b);
17
18 String filename = getFilename("bin/file_test.cc");
19 File file = new File(filename);
20 InputStream input = file.openInputStream();
21 try {
22 input.readInto(a, 0, 1);
23 Expect.fail("no exception thrown");
24 } catch (var e) {
25 Expect.isTrue(e is UnsupportedOperationException);
26 }
27 Expect.equals(0, a[0]);
28 Expect.equals(0, b[0]);
29 }
OLDNEW
« no previous file with comments | « tests/standalone/src/io/ProcessWorkingDirectoryTest.dart ('k') | tests/standalone/src/io/Regress-1925.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698