mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
… rather than as an extra step after `cargo doc`. This helps always using the correct set of CSS properties (for layout 2013 v.s. 2020).
27 lines
890 B
Rust
27 lines
890 B
Rust
/* 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 serde_json::{self, Value};
|
|
use std::env;
|
|
use std::fs::File;
|
|
use std::path::Path;
|
|
|
|
#[test]
|
|
fn properties_list_json() {
|
|
let top = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap())
|
|
.join("..")
|
|
.join("..")
|
|
.join("..");
|
|
let json = top
|
|
.join("target")
|
|
.join("doc")
|
|
.join("servo")
|
|
.join("css-properties.json");
|
|
|
|
let properties: Value = serde_json::from_reader(File::open(json).unwrap()).unwrap();
|
|
let longhands = properties["longhands"].as_object().unwrap();
|
|
assert!(longhands.len() > 100);
|
|
assert!(longhands.get("margin-top").is_some());
|
|
assert!(properties["shorthands"].get("margin").is_some());
|
|
}
|