properly emit separator in join when both are under 2 length

This commit is contained in:
ConnorSkees 2020-04-02 18:19:54 -04:00
parent dbf699a991
commit a9230b7877
2 changed files with 6 additions and 3 deletions

View File

@ -162,9 +162,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
) {
Value::Ident(s, ..) => match s.as_str() {
"auto" => {
if list1.len() < 2 && list2.len() < 2 {
ListSeparator::Space
} else if list1.is_empty() {
if list1.is_empty() {
sep2
} else {
sep1

View File

@ -212,6 +212,11 @@ test!(
"a {\n color: join((), (a, b, c));\n}\n",
"a {\n color: a, b, c;\n}\n"
);
test!(
join_single_comma_both,
"a {\n color: join((a,), (b,));\n}\n",
"a {\n color: a, b;\n}\n"
);
test!(bracketed_ident, "a {\n color: [a];\n}\n");
test!(bracketed_space_list, "a {\n color: [a b];\n}\n");
test!(bracketed_comma_list, "a {\n color: [a, b];\n}\n");