| 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 analyzer.test.file_system.memory_file_system_test; | 5 library analyzer.test.file_system.memory_file_system_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:core'; | 8 import 'dart:core'; |
| 9 | 9 |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 source = file.createSource(); | 458 source = file.createSource(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 void test_contents() { | 461 void test_contents() { |
| 462 TimestampedData<String> contents = source.contents; | 462 TimestampedData<String> contents = source.contents; |
| 463 expect(contents.data, 'library test;'); | 463 expect(contents.data, 'library test;'); |
| 464 } | 464 } |
| 465 | 465 |
| 466 void test_encoding() { | 466 void test_encoding() { |
| 467 String expected = 'file:///foo/test.dart'; | 467 String expected = 'file:///foo/test.dart'; |
| 468 if (provider.pathContext == windows) { | 468 if (provider.pathContext.style == windows.style) { |
| 469 expected = 'file:///C:/foo/test.dart'; | 469 expected = 'file:///C:/foo/test.dart'; |
| 470 } | 470 } |
| 471 expect(source.encoding, expected); | 471 expect(source.encoding, expected); |
| 472 } | 472 } |
| 473 | 473 |
| 474 void test_equals_false_differentFile() { | 474 void test_equals_false_differentFile() { |
| 475 File fileA = provider.newFile(provider.convertPath('/foo/a.dart'), ''); | 475 File fileA = provider.newFile(provider.convertPath('/foo/a.dart'), ''); |
| 476 File fileB = provider.newFile(provider.convertPath('/foo/b.dart'), ''); | 476 File fileB = provider.newFile(provider.convertPath('/foo/b.dart'), ''); |
| 477 Source sourceA = fileA.createSource(); | 477 Source sourceA = fileA.createSource(); |
| 478 Source sourceB = fileB.createSource(); | 478 Source sourceB = fileB.createSource(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 545 } |
| 546 | 546 |
| 547 void test_contents() { | 547 void test_contents() { |
| 548 expect(() { | 548 expect(() { |
| 549 source.contents; | 549 source.contents; |
| 550 }, throwsA(_isFileSystemException)); | 550 }, throwsA(_isFileSystemException)); |
| 551 } | 551 } |
| 552 | 552 |
| 553 void test_encoding() { | 553 void test_encoding() { |
| 554 String expected = 'file:///foo/test.dart'; | 554 String expected = 'file:///foo/test.dart'; |
| 555 if (provider.pathContext == windows) { | 555 if (provider.pathContext.style == windows.style) { |
| 556 expected = 'file:///C:/foo/test.dart'; | 556 expected = 'file:///C:/foo/test.dart'; |
| 557 } | 557 } |
| 558 expect(source.encoding, expected); | 558 expect(source.encoding, expected); |
| 559 } | 559 } |
| 560 | 560 |
| 561 void test_exists() { | 561 void test_exists() { |
| 562 expect(source.exists(), isFalse); | 562 expect(source.exists(), isFalse); |
| 563 } | 563 } |
| 564 | 564 |
| 565 void test_fullName() { | 565 void test_fullName() { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 return new Future.delayed(Duration.ZERO, computation); | 770 return new Future.delayed(Duration.ZERO, computation); |
| 771 } | 771 } |
| 772 | 772 |
| 773 _watchingFolder(String path, test(List<WatchEvent> changesReceived)) { | 773 _watchingFolder(String path, test(List<WatchEvent> changesReceived)) { |
| 774 Folder folder = provider.getResource(path); | 774 Folder folder = provider.getResource(path); |
| 775 var changesReceived = <WatchEvent>[]; | 775 var changesReceived = <WatchEvent>[]; |
| 776 folder.changes.listen(changesReceived.add); | 776 folder.changes.listen(changesReceived.add); |
| 777 return test(changesReceived); | 777 return test(changesReceived); |
| 778 } | 778 } |
| 779 } | 779 } |
| OLD | NEW |