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

Unified Diff: pkg/source_maps/test/span_test.dart

Issue 20600002: Fix source spans hashcode implementation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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
« pkg/source_maps/lib/span.dart ('K') | « pkg/source_maps/lib/span.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/source_maps/test/span_test.dart
diff --git a/pkg/source_maps/test/span_test.dart b/pkg/source_maps/test/span_test.dart
index c7b9cde16ed5f73f83e09fdb9c046c5191fef29b..da3e063ef421a2f3cfed58ce33f9807d1a375c4d 100644
--- a/pkg/source_maps/test/span_test.dart
+++ b/pkg/source_maps/test/span_test.dart
@@ -316,6 +316,16 @@ main() {
expect(file.span(8, 9, null).isIdentifier, false);
expect(new FixedSpan('', 8, 1, 8, isIdentifier: null).isIdentifier, false);
});
+
+ test('span/location implement == and hashCode', () {
+ expect(identical(span(10, 14), span(10, 14)), isFalse);
+ expect(span(10, 14), equals(span(10, 14)));
+ expect(span(10, 14).hashCode, span(10, 14).hashCode);
+
+ expect(identical(loc(13), loc(13)), isFalse);
+ expect(loc(13), equals(loc(13)));
+ expect(loc(13).hashCode, loc(13).hashCode);
+ });
}
class TestSpan extends Span {
« pkg/source_maps/lib/span.dart ('K') | « pkg/source_maps/lib/span.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698