Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: pkg/analysis_server/test/resource_test.dart

Issue 300023004: Partial implementation of the 'setAnalysisRoots' API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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');
});
« pkg/analysis_server/test/domain_analysis_test.dart ('K') | « pkg/analysis_server/test/mocks.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698