| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library test.resource; | 5 library test.resource; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
| 9 | 9 |
| 10 import 'mocks.dart'; | 10 import 'mocks.dart'; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 test('true', () { | 235 test('true', () { |
| 236 provider.newFile('/foo/file.txt', 'qwerty'); | 236 provider.newFile('/foo/file.txt', 'qwerty'); |
| 237 File file = provider.getResource('/foo/file.txt'); | 237 File file = provider.getResource('/foo/file.txt'); |
| 238 expect(file, isNotNull); | 238 expect(file, isNotNull); |
| 239 expect(file.exists, isTrue); | 239 expect(file.exists, isTrue); |
| 240 }); | 240 }); |
| 241 }); | 241 }); |
| 242 | 242 |
| 243 test('fullName', () { | 243 test('fullName', () { |
| 244 File file = provider.getResource('/foo/bar/file.txt'); | 244 File file = provider.getResource('/foo/bar/file.txt'); |
| 245 expect(file.fullName, '/foo/bar/file.txt'); | 245 expect(file.path, '/foo/bar/file.txt'); |
| 246 }); | 246 }); |
| 247 | 247 |
| 248 test('hashCode', () { | 248 test('hashCode', () { |
| 249 File file = provider.getResource('/foo/bar/file.txt'); | 249 File file = provider.getResource('/foo/bar/file.txt'); |
| 250 file.hashCode; | 250 file.hashCode; |
| 251 }); | 251 }); |
| 252 | 252 |
| 253 test('shortName', () { | 253 test('shortName', () { |
| 254 File file = provider.getResource('/foo/bar/file.txt'); | 254 File file = provider.getResource('/foo/bar/file.txt'); |
| 255 expect(file.shortName, 'file.txt'); | 255 expect(file.shortName, 'file.txt'); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 expect(file.exists, isFalse); | 546 expect(file.exists, isFalse); |
| 547 }); | 547 }); |
| 548 | 548 |
| 549 test('true', () { | 549 test('true', () { |
| 550 new io.File(path).writeAsStringSync('contents'); | 550 new io.File(path).writeAsStringSync('contents'); |
| 551 expect(file.exists, isTrue); | 551 expect(file.exists, isTrue); |
| 552 }); | 552 }); |
| 553 }); | 553 }); |
| 554 | 554 |
| 555 test('fullName', () { | 555 test('fullName', () { |
| 556 expect(file.fullName, path); | 556 expect(file.path, path); |
| 557 }); | 557 }); |
| 558 | 558 |
| 559 test('hashCode', () { | 559 test('hashCode', () { |
| 560 file.hashCode; | 560 file.hashCode; |
| 561 }); | 561 }); |
| 562 | 562 |
| 563 test('shortName', () { | 563 test('shortName', () { |
| 564 expect(file.shortName, 'file.txt'); | 564 expect(file.shortName, 'file.txt'); |
| 565 }); | 565 }); |
| 566 | 566 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 expect(children[1], _isFolder); | 623 expect(children[1], _isFolder); |
| 624 expect(children[2], _isFile); | 624 expect(children[2], _isFile); |
| 625 }); | 625 }); |
| 626 }); | 626 }); |
| 627 }); | 627 }); |
| 628 } | 628 } |
| 629 | 629 |
| 630 var _isFile = new isInstanceOf<File>(); | 630 var _isFile = new isInstanceOf<File>(); |
| 631 var _isFolder = new isInstanceOf<Folder>(); | 631 var _isFolder = new isInstanceOf<Folder>(); |
| 632 var _isMemoryResourceException = new isInstanceOf<MemoryResourceException>(); | 632 var _isMemoryResourceException = new isInstanceOf<MemoryResourceException>(); |
| OLD | NEW |