Add test cases for transition-duration.

This commit is contained in:
Simon Whitehead 2017-02-23 23:30:02 +11:00 committed by Hiroyuki Ikezoe
parent 130a08f0b5
commit 2e3f45b66b
2 changed files with 18 additions and 0 deletions

View file

@ -105,6 +105,7 @@ mod selectors;
mod supports;
mod text;
mod text_overflow;
mod transition_duration;
mod transition_property;
mod transition_timing_function;
mod ui;

View file

@ -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 http://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());
}