This commit is contained in:
ConnorSkees 2020-05-24 13:50:45 -04:00
parent b5c1fb2013
commit 812e9fec9c
6 changed files with 11 additions and 16 deletions

View File

@ -628,7 +628,10 @@ impl Value {
Self::Dimension(num, unit).div(other.eval(span)?.node, span)? Self::Dimension(num, unit).div(other.eval(span)?.node, span)?
} }
Self::List(..) | Self::True | Self::False | Self::Important | Self::Color(..) => { Self::List(..) | Self::True | Self::False | Self::Important | Self::Color(..) => {
Value::String(format!("{}{}/{}", num, unit, other.to_css_string(span)?), QuoteKind::None) Value::String(
format!("{}{}/{}", num, unit, other.to_css_string(span)?),
QuoteKind::None,
)
} }
Self::Null => Value::String(format!("{}{}/", num, unit), QuoteKind::None), Self::Null => Value::String(format!("{}{}/", num, unit), QuoteKind::None),
Self::Map(..) | Self::Function(..) => { Self::Map(..) | Self::Function(..) => {

View File

@ -601,7 +601,8 @@ impl Value {
"url" => match try_eat_url(toks, scope, super_selector)? { "url" => match try_eat_url(toks, scope, super_selector)? {
Some(val) => s = val, Some(val) => s = val,
None => s.push_str( None => s.push_str(
&eat_call_args(toks, pos)?.to_css_string(scope, super_selector)?, &eat_call_args(toks, pos)?
.to_css_string(scope, super_selector)?,
), ),
}, },
_ => s.push_str( _ => s.push_str(

View File

@ -49,6 +49,5 @@ test!(
// and should be "expected \")\"." // and should be "expected \")\"."
error!( error!(
nothing_after_open, nothing_after_open,
"a { color:rgb(; }", "a { color:rgb(; }", "Error: expected \"{\"."
"Error: expected \"{\"." );
);

View File

@ -65,8 +65,7 @@ test!(
); );
error!( error!(
num_div_map, num_div_map,
"a {\n color: 1 / (a: b);\n}\n", "a {\n color: 1 / (a: b);\n}\n", "Error: (a: b) isn't a valid CSS value."
"Error: (a: b) isn't a valid CSS value."
); );
error!( error!(
num_div_function, num_div_function,

View File

@ -549,7 +549,4 @@ error!(
non_ident_char_after_colon, non_ident_char_after_colon,
":#ab {}", "Error: Expected identifier." ":#ab {}", "Error: Expected identifier."
); );
error!( error!(nothing_after_colon, "a:{}", "Error: Expected identifier.");
nothing_after_colon,
"a:{}", "Error: Expected identifier."
);

View File

@ -15,8 +15,4 @@ test!(
"@#{()if(0,0<0,0)}", "@#{()if(0,0<0,0)}",
"@false;\n" "@false;\n"
); );
test!( test!(nothing_after_hash, "@foo #", "@foo #;\n");
nothing_after_hash,
"@foo #",
"@foo #;\n"
);