box_.rs (876B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 4 5 use parsing::parse; 6 use style_traits::ToCss; 7 8 #[test] 9 fn test_transform_translate() { 10 use style::properties::longhands::transform; 11 assert_roundtrip_with_context!(transform::parse, "translate(2px)"); 12 assert_roundtrip_with_context!(transform::parse, "translate(2px, 5px)"); 13 assert!(parse(transform::parse, "translate(2px foo)").is_err()); 14 assert!(parse(transform::parse, "perspective(-10px)").is_err()); 15 } 16 17 #[test] 18 fn test_unexhausted_transform() { 19 use style::properties::longhands::transform; 20 assert_parser_exhausted!(transform::parse, "rotate(70deg)foo", false); 21 assert_parser_exhausted!(transform::parse, "rotate(70deg) foo", false); 22 }