mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Fix up and run unit tests.
This adds the subpackages to `./mach test-unit`.
This commit is contained in:
parent
76d1d78cc0
commit
7f6f072b02
6 changed files with 33 additions and 26 deletions
|
@ -999,6 +999,7 @@ mod tests {
|
|||
use sync::Arc;
|
||||
use super::{DeclarationBlock, Rule, SelectorMap};
|
||||
use selectors::LocalName;
|
||||
use string_cache::Atom;
|
||||
|
||||
/// Helper method to get some Rules from selector strings.
|
||||
/// Each sublist of the result contains the Rules for one StyleRule.
|
||||
|
@ -1043,7 +1044,7 @@ mod tests {
|
|||
fn test_get_class_name(){
|
||||
let rules_list = get_mock_rules([".intro.foo", "#top"]);
|
||||
assert_eq!(SelectorMap::get_class_name(&rules_list[0][0]), Some(Atom::from_slice("intro")));
|
||||
assert_eq!(SelectorMap::get_class_name(rules_list.get(1).get(0)), None);
|
||||
assert_eq!(SelectorMap::get_class_name(&rules_list[1][0]), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -574,6 +574,7 @@ mod tests {
|
|||
use sync::Arc;
|
||||
use cssparser;
|
||||
use namespaces::NamespaceMap;
|
||||
use string_cache::Atom;
|
||||
use super::*;
|
||||
|
||||
fn parse(input: &str) -> Result<Vec<Selector>, ()> {
|
||||
|
@ -649,8 +650,8 @@ mod tests {
|
|||
assert!(parse_ns("[Foo]", &namespaces) == Ok(vec!(Selector {
|
||||
compound_selectors: Arc::new(CompoundSelector {
|
||||
simple_selectors: vec!(AttrExists(AttrSelector {
|
||||
name: Atom::from_slice("Foo"),
|
||||
lower_name: Atom::from_slice("foo"),
|
||||
name: String::from_str("Foo"),
|
||||
lower_name: String::from_str("foo"),
|
||||
namespace: SpecificNamespace(ns!("")),
|
||||
})),
|
||||
next: None,
|
||||
|
@ -664,8 +665,8 @@ mod tests {
|
|||
assert!(parse_ns("[Foo]", &namespaces) == Ok(vec!(Selector {
|
||||
compound_selectors: Arc::new(CompoundSelector {
|
||||
simple_selectors: vec!(AttrExists(AttrSelector {
|
||||
name: Atom::from_slice("Foo"),
|
||||
lower_name: Atom::from_slice("foo"),
|
||||
name: String::from_str("Foo"),
|
||||
lower_name: String::from_str("foo"),
|
||||
namespace: SpecificNamespace(ns!("")),
|
||||
})),
|
||||
next: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue