mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add unit tests for step timing function.
This commit is contained in:
parent
99ef3d701a
commit
cad0cd3711
2 changed files with 17 additions and 0 deletions
|
@ -25,11 +25,15 @@ fn test_cubic_bezier() {
|
|||
#[test]
|
||||
fn test_steps() {
|
||||
assert_roundtrip_with_context!(transition_timing_function::parse, "steps(1)");
|
||||
assert_roundtrip_with_context!(transition_timing_function::parse, "steps( 1)", "steps(1)");
|
||||
assert_roundtrip_with_context!(transition_timing_function::parse, "steps(1, start)");
|
||||
assert_roundtrip_with_context!(transition_timing_function::parse, "steps(2, end) ", "steps(2)");
|
||||
|
||||
// Step interval value must be an integer greater than 0
|
||||
assert!(parse(transition_timing_function::parse, "steps(0)").is_err());
|
||||
assert!(parse(transition_timing_function::parse, "steps(0.5)").is_err());
|
||||
assert!(parse(transition_timing_function::parse, "steps(-1)").is_err());
|
||||
assert!(parse(transition_timing_function::parse, "steps(1, middle)").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue