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

Side by Side Diff: tests/standalone/io/string_stream_test.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/socket_invalid_arguments_test.dart ('k') | tests/utils/dummy.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #import("dart:io"); 5 #import("dart:io");
6 6
7 void testUtf8() { 7 void testUtf8() {
8 List<int> data = [0x01, 8 List<int> data = [0x01,
9 0x7f, 9 0x7f,
10 0xc2, 0x80, 10 0xc2, 0x80,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 TestException(); 169 TestException();
170 } 170 }
171 171
172 class ErrorInputStream implements InputStream { 172 class ErrorInputStream implements InputStream {
173 ErrorInputStream(); 173 ErrorInputStream();
174 List<int> read([int len]) => null; 174 List<int> read([int len]) => null;
175 int readInto(List<int> buffer, [int offset, int len]) => 0; 175 int readInto(List<int> buffer, [int offset, int len]) => 0;
176 int available() => 0; 176 int available() => 0;
177 void pipe(OutputStream output, [bool close]){ } 177 void pipe(OutputStream output, [bool close]){ }
178 void close() { } 178 void close() { }
179 bool get closed() => true; 179 bool get closed => true;
180 void set onData(void callback()) { } 180 void set onData(void callback()) { }
181 void set onClosed(void callback()) { } 181 void set onClosed(void callback()) { }
182 void set onError(void callback(Exception e)) { 182 void set onError(void callback(Exception e)) {
183 callback(new TestException()); 183 callback(new TestException());
184 } 184 }
185 } 185 }
186 186
187 testErrorHandler() { 187 testErrorHandler() {
188 var errors = 0; 188 var errors = 0;
189 var stream = new StringInputStream(new ErrorInputStream()); 189 var stream = new StringInputStream(new ErrorInputStream());
190 stream.onError = (e) { 190 stream.onError = (e) {
191 errors++; 191 errors++;
192 Expect.isTrue(e is TestException); 192 Expect.isTrue(e is TestException);
193 }; 193 };
194 Expect.equals(1, errors); 194 Expect.equals(1, errors);
195 } 195 }
196 196
197 main() { 197 main() {
198 testUtf8(); 198 testUtf8();
199 testLatin1(); 199 testLatin1();
200 testAscii(); 200 testAscii();
201 testReadLine1(); 201 testReadLine1();
202 testReadLine2(); 202 testReadLine2();
203 testErrorHandler(); 203 testErrorHandler();
204 } 204 }
OLDNEW
« no previous file with comments | « tests/standalone/io/socket_invalid_arguments_test.dart ('k') | tests/utils/dummy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698