mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Fix incorrect unit test.
This commit is contained in:
parent
f69983930d
commit
9326e411e3
1 changed files with 6 additions and 7 deletions
|
@ -321,11 +321,12 @@ fn test_mq_multiple_expressions() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_mq_malformed_expressions() {
|
fn test_mq_malformed_expressions() {
|
||||||
fn check_malformed_expr(list: &MediaList, css: &str) {
|
fn check_malformed_expr(list: &MediaList, css: &str) {
|
||||||
assert!(list.media_queries.len() == 1, css.to_owned());
|
assert!(!list.media_queries.is_empty(), css.to_owned());
|
||||||
let q = &list.media_queries[0];
|
for mq in &list.media_queries {
|
||||||
assert!(q.qualifier == Some(Qualifier::Not), css.to_owned());
|
assert!(mq.qualifier == Some(Qualifier::Not), css.to_owned());
|
||||||
assert!(q.media_type == MediaQueryType::All, css.to_owned());
|
assert!(mq.media_type == MediaQueryType::All, css.to_owned());
|
||||||
assert!(q.expressions.len() == 0, css.to_owned());
|
assert!(mq.expressions.is_empty(), css.to_owned());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for rule in &[
|
for rule in &[
|
||||||
|
@ -335,8 +336,6 @@ fn test_mq_malformed_expressions() {
|
||||||
"@media not {}",
|
"@media not {}",
|
||||||
"@media not (min-width: 300px) {}",
|
"@media not (min-width: 300px) {}",
|
||||||
"@media , {}",
|
"@media , {}",
|
||||||
"@media screen 4px, print {}",
|
|
||||||
"@media screen, {}",
|
|
||||||
] {
|
] {
|
||||||
test_media_rule(rule, check_malformed_expr);
|
test_media_rule(rule, check_malformed_expr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue