summaryrefslogtreecommitdiffstats
path: root/servo/tests/unit/style/parsing/transition_duration.rs
diff options
context:
space:
mode:
Diffstat (limited to 'servo/tests/unit/style/parsing/transition_duration.rs')
-rw-r--r--servo/tests/unit/style/parsing/transition_duration.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/servo/tests/unit/style/parsing/transition_duration.rs b/servo/tests/unit/style/parsing/transition_duration.rs
new file mode 100644
index 0000000000..c771a58944
--- /dev/null
+++ b/servo/tests/unit/style/parsing/transition_duration.rs
@@ -0,0 +1,17 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+
+use parsing::parse;
+use style::properties::longhands::transition_duration;
+
+#[test]
+fn test_positive_transition_duration() {
+ assert!(parse(transition_duration::parse, "5s").is_ok());
+ assert!(parse(transition_duration::parse, "0s").is_ok());
+}
+
+#[test]
+fn test_negative_transition_duration() {
+ assert!(parse(transition_duration::parse, "-5s").is_err());
+}