From 93cee84f9ffc1a947fd756e94fd322d42d0bbf3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20H=C3=A4ssig?= Date: Mon, 2 Oct 2017 12:52:33 +0200 Subject: [PATCH] removed rustc_serialize in style tests --- Cargo.lock | 2 +- tests/unit/style/Cargo.toml | 2 +- tests/unit/style/lib.rs | 2 +- tests/unit/style/properties/scaffolding.rs | 9 +++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 19ac18f08fdb..50562c30d451 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3201,8 +3201,8 @@ dependencies = [ "html5ever 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.19.0", + "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "servo_arc 0.0.1", "servo_atoms 0.0.1", "servo_config 0.0.1", diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml index e979b350ec17..c358b846ba69 100644 --- a/tests/unit/style/Cargo.toml +++ b/tests/unit/style/Cargo.toml @@ -17,7 +17,7 @@ euclid = "0.15" html5ever = "0.20" parking_lot = "0.4" rayon = "0.8" -rustc-serialize = "0.3" +serde_json = "1.0" selectors = {path = "../../../components/selectors"} servo_arc = {path = "../../../components/servo_arc"} servo_atoms = {path = "../../../components/atoms"} diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index c1eab17d1b60..f912af005744 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -11,8 +11,8 @@ extern crate euclid; #[macro_use] extern crate html5ever; extern crate parking_lot; extern crate rayon; -extern crate rustc_serialize; extern crate selectors; +extern crate serde_json; extern crate servo_arc; extern crate servo_atoms; extern crate servo_config; diff --git a/tests/unit/style/properties/scaffolding.rs b/tests/unit/style/properties/scaffolding.rs index cfb9c46770f3..b752937ad93f 100644 --- a/tests/unit/style/properties/scaffolding.rs +++ b/tests/unit/style/properties/scaffolding.rs @@ -2,7 +2,7 @@ * 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 rustc_serialize::json::Json; +use serde_json::{self, Value}; use std::env; use std::fs::{File, remove_file}; use std::path::Path; @@ -25,10 +25,11 @@ fn properties_list_json() { .status() .unwrap(); assert!(status.success()); - let properties = Json::from_reader(&mut File::open(json).unwrap()).unwrap(); + + let properties: Value = serde_json::from_reader(File::open(json).unwrap()).unwrap(); assert!(properties.as_object().unwrap().len() > 100); - assert!(properties.find("margin").is_some()); - assert!(properties.find("margin-top").is_some()); + assert!(properties.as_object().unwrap().contains_key("margin")); + assert!(properties.as_object().unwrap().contains_key("margin-top")); } #[cfg(windows)]