Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import 'package:pathos/path.dart' as path; | 8 import 'package:pathos/path.dart' as path; |
| 9 import 'package:scheduled_test/descriptor.dart' as d; | 9 import 'package:scheduled_test/descriptor.dart' as d; |
| 10 import 'package:scheduled_test/scheduled_test.dart'; | 10 import 'package:scheduled_test/scheduled_test.dart'; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 return new File(path.join(sandbox, 'name.txt')) | 222 return new File(path.join(sandbox, 'name.txt')) |
| 223 .writeAsString('barfoobaz'); | 223 .writeAsString('barfoobaz'); |
| 224 }); | 224 }); |
| 225 | 225 |
| 226 d.matcherFile('name.txt', contains('baaz')).validate(); | 226 d.matcherFile('name.txt', contains('baaz')).validate(); |
| 227 }); | 227 }); |
| 228 | 228 |
| 229 test('test 2', () { | 229 test('test 2', () { |
| 230 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); | 230 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
| 231 expect(errors.map((e) => e.error.message), equals([ | 231 expect(errors.map((e) => e.error.message), equals([ |
| 232 "Expected: contains 'baaz'\n But: was 'barfoobaz'.\n" | 232 "Expected: contains 'baaz'\n But: was 'barfoobaz'.\nActual: 'barfoob az'" |
|
Siggi Cherem (dart-lang)
2013/06/04 15:45:29
80 col
| |
| 233 ]), verbose: true); | 233 ]), verbose: true); |
| 234 }); | 234 }); |
| 235 }, passing: ['test 2']); | 235 }, passing: ['test 2']); |
| 236 | 236 |
| 237 expectTestsPass('binaryMatcherFile().validate() completes successfully if ' | 237 expectTestsPass('binaryMatcherFile().validate() completes successfully if ' |
| 238 'the string contents of the file matches the matcher', () { | 238 'the string contents of the file matches the matcher', () { |
| 239 test('test', () { | 239 test('test', () { |
| 240 scheduleSandbox(); | 240 scheduleSandbox(); |
| 241 | 241 |
| 242 schedule(() { | 242 schedule(() { |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 264 }); | 264 }); |
| 265 | 265 |
| 266 d.binaryMatcherFile('name.txt', contains(12)).validate(); | 266 d.binaryMatcherFile('name.txt', contains(12)).validate(); |
| 267 }); | 267 }); |
| 268 | 268 |
| 269 test('test 2', () { | 269 test('test 2', () { |
| 270 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); | 270 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
| 271 expect(errors.map((e) => e.error.message), equals([ | 271 expect(errors.map((e) => e.error.message), equals([ |
| 272 "Expected: contains <12>\n" | 272 "Expected: contains <12>\n" |
| 273 " But: was [98, 97, 114, 102, 111, 111, 98, 97, 122].\n" | 273 " But: was [98, 97, 114, 102, 111, 111, 98, 97, 122].\n" |
| 274 "Actual: [98, 97, 114, 102, 111, 111, 98, 97, 122]" | |
| 274 ]), verbose: true); | 275 ]), verbose: true); |
| 275 }); | 276 }); |
| 276 }, passing: ['test 2']); | 277 }, passing: ['test 2']); |
| 277 } | 278 } |
| OLD | NEW |