mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Fix the unit tests to use context
This commit is contained in:
parent
dee1a65a69
commit
f290a6f88c
4 changed files with 51 additions and 57 deletions
|
@ -3,11 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::{Parser, ToCss};
|
||||
use media_queries::CSSErrorReporterTest;
|
||||
use selectors::parser::SelectorList;
|
||||
use style::parser::ParserContext;
|
||||
use style::selector_parser::{SelectorImpl, SelectorParser};
|
||||
use style::stylesheets::{Origin, Namespaces};
|
||||
|
||||
fn parse(input: &mut Parser) -> Result<SelectorList<SelectorImpl>, ()> {
|
||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SelectorList<SelectorImpl>, ()> {
|
||||
let mut ns = Namespaces::default();
|
||||
ns.prefixes.insert("svg".into(), ns!(svg));
|
||||
let parser = SelectorParser {
|
||||
|
@ -19,8 +21,8 @@ fn parse(input: &mut Parser) -> Result<SelectorList<SelectorImpl>, ()> {
|
|||
|
||||
#[test]
|
||||
fn test_selectors() {
|
||||
assert_roundtrip!(parse, "div");
|
||||
assert_roundtrip!(parse, "svg|circle");
|
||||
assert_roundtrip!(parse, "p:before", "p::before");
|
||||
assert_roundtrip!(parse, "[border = \"0\"]:-servo-nonzero-border ~ ::-servo-details-summary");
|
||||
assert_roundtrip_with_context!(parse, "div");
|
||||
assert_roundtrip_with_context!(parse, "svg|circle");
|
||||
assert_roundtrip_with_context!(parse, "p:before", "p::before");
|
||||
assert_roundtrip_with_context!(parse, "[border = \"0\"]:-servo-nonzero-border ~ ::-servo-details-summary");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue