Chromium Code Reviews| Index: pkg/analysis_server/test/resource_test.dart |
| diff --git a/pkg/analysis_server/test/resource_test.dart b/pkg/analysis_server/test/resource_test.dart |
| index ec1a67d10e5a2c077038c0fa9c16faa2bf004221..870ee819beba7f16d785dca0635ba78e3979cf51 100644 |
| --- a/pkg/analysis_server/test/resource_test.dart |
| +++ b/pkg/analysis_server/test/resource_test.dart |
| @@ -223,6 +223,14 @@ main() { |
| File file = provider.getResource('/file.txt'); |
| expect(file == file, isTrue); |
| }); |
| + |
| + test('before and after creation', () { |
| + String path = '/file.txt'; |
| + File file1 = provider.getResource(path); |
| + provider.newFile(path, 'contents'); |
| + File file2 = provider.getResource(path); |
| + expect(file1 == file2, isTrue); |
| + }); |
| }); |
| group('exists', () { |
| @@ -246,8 +254,11 @@ main() { |
| }); |
| test('hashCode', () { |
| - File file = provider.getResource('/foo/bar/file.txt'); |
| - file.hashCode; |
| + String path = '/foo/bar/file.txt'; |
| + File file1 = provider.getResource(path); |
| + provider.newFile(path, 'contents'); |
| + File file2 = provider.getResource(path); |
| + expect(file1.hashCode, equals(file2.hashCode)); |
| }); |
| test('shortName', () { |
| @@ -271,9 +282,20 @@ main() { |
| group('Folder', () { |
| Folder folder; |
| + const String path = '/foo/bar'; |
| setUp(() { |
| - folder = provider.newFolder('/foo/bar'); |
| + folder = provider.newFolder(path); |
| + }); |
| + |
| + test('hashCode', () { |
| + Folder folder2 = provider.getResource(path); |
| + expect(folder.hashCode, equals(folder2.hashCode)); |
| + }); |
| + |
| + test('equality', () { |
| + Folder folder2 = provider.getResource(path); |
| + expect(folder == folder2, isTrue); |
|
scheglov
2014/07/02 00:32:56
Any test for a case when == returns false for memo
Paul Berry
2014/07/02 00:37:15
Good point. I'll add those.
|
| }); |
| group('getChild', () { |