diff --git a/src/value/ops.rs b/src/value/ops.rs index fbcccdd..2d153de 100644 --- a/src/value/ops.rs +++ b/src/value/ops.rs @@ -120,6 +120,9 @@ impl Sub for Value { Self::List(..) => { Value::Ident(format!("{}{}-{}", num, unit, other), QuoteKind::None) } + Self::Ident(..) => { + Value::Ident(format!("{}{}-{}", num, unit, other), QuoteKind::None) + } _ => todo!(), }, Self::Color(c) => match other { diff --git a/tests/subtraction.rs b/tests/subtraction.rs index 7b14e01..e43729f 100644 --- a/tests/subtraction.rs +++ b/tests/subtraction.rs @@ -153,3 +153,18 @@ test!( "a {\n color: 'foo' - 1px;\n}\n", "a {\n color: \"foo\"-1px;\n}\n" ); +test!( + number_minus_unquoted_ident, + "a {\n color: 1 - foo;\n}\n", + "a {\n color: 1-foo;\n}\n" +); +test!( + number_minus_sglquoted_ident, + "a {\n color: 1 - 'foo';\n}\n", + "a {\n color: 1-\"foo\";\n}\n" +); +test!( + number_minus_dblquoted_ident, + "a {\n color: 1 - \"foo\";\n}\n", + "a {\n color: 1-\"foo\";\n}\n" +);