| 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 4818dc6e3289cfc0cdd2c522f9aae79f39aeb18a..1c9366b218096888e5b5f4d26daceeb005ff8674 100644
|
| --- a/pkg/analysis_server/test/resource_test.dart
|
| +++ b/pkg/analysis_server/test/resource_test.dart
|
| @@ -134,6 +134,39 @@ main() {
|
| source = file.createSource(UriKind.FILE_URI);
|
| });
|
|
|
| + group('==', () {
|
| + group('true', () {
|
| + test('self', () {
|
| + File file = provider.newFile('/foo/test.dart', '');
|
| + Source source = file.createSource(UriKind.FILE_URI);
|
| + expect(source == source, isTrue);
|
| + });
|
| +
|
| + test('same file', () {
|
| + File file = provider.newFile('/foo/test.dart', '');
|
| + Source sourceA = file.createSource(UriKind.FILE_URI);
|
| + Source sourceB = file.createSource(UriKind.FILE_URI);
|
| + expect(sourceA == sourceB, isTrue);
|
| + });
|
| + });
|
| +
|
| + group('false', () {
|
| + test('not a memory Source', () {
|
| + File file = provider.newFile('/foo/test.dart', '');
|
| + Source source = file.createSource(UriKind.FILE_URI);
|
| + expect(source == new Object(), isFalse);
|
| + });
|
| +
|
| + test('different file', () {
|
| + File fileA = provider.newFile('/foo/a.dart', '');
|
| + File fileB = provider.newFile('/foo/b.dart', '');
|
| + Source sourceA = fileA.createSource(UriKind.FILE_URI);
|
| + Source sourceB = fileB.createSource(UriKind.FILE_URI);
|
| + expect(sourceA == sourceB, isFalse);
|
| + });
|
| + });
|
| + });
|
| +
|
| test('contents', () {
|
| TimestampedData<String> contents = source.contents;
|
| expect(contents.data, 'library test;');
|
| @@ -151,6 +184,10 @@ main() {
|
| expect(source.fullName, '/foo/test.dart');
|
| });
|
|
|
| + test('hashCode', () {
|
| + source.hashCode;
|
| + });
|
| +
|
| test('shortName', () {
|
| expect(source.shortName, 'test.dart');
|
| });
|
|
|