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

Unified Diff: test/iron_range_behavior_test.dart

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 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
« no previous file with comments | « test/iron_overlay_behavior_test.dart ('k') | test/iron_selector_activate_event_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/iron_range_behavior_test.dart
diff --git a/test/iron_range_behavior_test.dart b/test/iron_range_behavior_test.dart
index 28bb34ced9de8f13408859aa56069afd5281b79b..83619884e477836f16f4cd4a9b35ff03b33972d4 100644
--- a/test/iron_range_behavior_test.dart
+++ b/test/iron_range_behavior_test.dart
@@ -73,6 +73,42 @@ main() async {
await wait(1);
expect(range.value, 5.1);
});
+
+ test('odd values', () async {
+ range.min = 1;
+ range.max = 7;
+ range.step = 2;
+ range.value = 3;
+
+ await wait(1);
+ expect(range.value, 3);
+
+ range.value += range.step;
+ expect(range.value, 5);
+
+ range.value += range.step;
+ expect(range.value, 7);
+ });
+
+ test('negative values should round up', () async {
+ range.min = -10;
+ range.max = 10;
+ range.step = 0.1;
+ range.value = -8.4252;
+
+ await wait(1);
+ expect(range.value, -8.4);
+ });
+
+ test('positive values should round up', () async {
+ range.min = 10;
+ range.max = 100;
+ range.step = 0.25;
+ range.value = 19.34567;
+
+ await wait(1);
+ expect(range.value, 19.25);
+ });
});
}
« no previous file with comments | « test/iron_overlay_behavior_test.dart ('k') | test/iron_selector_activate_event_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698