tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

column.rs (1058B)


      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_column_width() {
     10    use style::properties::longhands::column_width;
     11 
     12    assert_roundtrip_with_context!(column_width::parse, "auto");
     13    assert_roundtrip_with_context!(column_width::parse, "6px");
     14    assert_roundtrip_with_context!(column_width::parse, "2.5em");
     15    assert_roundtrip_with_context!(column_width::parse, "0.3vw");
     16 
     17    assert!(parse(column_width::parse, "-6px").is_err());
     18 }
     19 
     20 #[test]
     21 fn test_column_gap() {
     22    use style::properties::longhands::column_gap;
     23 
     24    assert_roundtrip_with_context!(column_gap::parse, "normal");
     25    assert_roundtrip_with_context!(column_gap::parse, "6px");
     26    assert_roundtrip_with_context!(column_gap::parse, "2.5em");
     27    assert_roundtrip_with_context!(column_gap::parse, "0.3vw");
     28 
     29    assert!(parse(column_gap::parse, "-6px").is_err());
     30 }