Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse sizes attribute implementation #10989

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

unit test cases

  • Loading branch information
sneha1302 committed May 4, 2016
commit 4dd0dc0440222bbc12e4ab9b2f0bc76c9539965e
@@ -62,6 +62,30 @@ fn some_parse_sizes_2_test() {
}
}
}

#[test]
fn some_parse_sizes_3_test() {
let mut result = parse_a_sizes_attribute(DOMString::from("(min-width: 900px) 1000px,
(max-width: 900px) and (min-width: 400px) 50em,
100vw "),
None);
let mut component = result.pop();
let mut component_secondlast = result.pop();
if component_secondlast.is_some() {
let component_query = component_secondlast.unwrap().query;
if component_query.is_some() {
let component_query_expr = component_query.unwrap().expressions;
match component_query_expr[0] {
Expression::Width(Range::Max(w)) => assert!(w == specified::Length::Absolute(Au::from_px(900))),
_ => panic!("wrong expression type"),
}
match component_query_expr[1] {
Expression::Width(Range::Min(w)) => assert!(w == specified::Length::Absolute(Au::from_px(400))),
_ => panic!("wrong expression type"),
}
}
}
}
extern crate msg;
extern crate script;
extern crate url;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.