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

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

Issue 345063005: Fix operator== and hashCode for File and Folder objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/physical_resource_provider_test.dart
diff --git a/pkg/analysis_server/test/physical_resource_provider_test.dart b/pkg/analysis_server/test/physical_resource_provider_test.dart
index a4b8a241ef1a1eaaf23d721365332cc78e6d48e9..47e75b9fda5fbb4fcbc1a54e92c139df237f275a 100644
--- a/pkg/analysis_server/test/physical_resource_provider_test.dart
+++ b/pkg/analysis_server/test/physical_resource_provider_test.dart
@@ -150,7 +150,15 @@ main() {
});
test('hashCode', () {
- file.hashCode;
+ new io.File(path).writeAsStringSync('contents');
+ File file2 = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(file.hashCode, equals(file2.hashCode));
+ });
+
+ test('equality', () {
+ new io.File(path).writeAsStringSync('contents');
+ File file2 = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(file == file2, isTrue);
});
test('shortName', () {
@@ -178,6 +186,16 @@ main() {
folder = PhysicalResourceProvider.INSTANCE.getResource(path);
});
+ test('hashCode', () {
+ Folder folder2 = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(folder.hashCode, equals(folder2.hashCode));
+ });
+
+ test('equality', () {
+ Folder folder2 = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(folder == folder2, isTrue);
+ });
+
group('getChild', () {
test('does not exist', () {
var child = folder.getChild('no-such-resource');

Powered by Google App Engine
This is Rietveld 408576698