From a9230b78777894978b6276f7e0a052acb9d2bfde Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Thu, 2 Apr 2020 18:19:54 -0400 Subject: [PATCH] properly emit separator in join when both are under 2 length --- src/builtin/list.rs | 4 +--- tests/list.rs | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/builtin/list.rs b/src/builtin/list.rs index 2de3e5b..bb7bbb7 100644 --- a/src/builtin/list.rs +++ b/src/builtin/list.rs @@ -162,9 +162,7 @@ pub(crate) fn register(f: &mut HashMap) { ) { 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 diff --git a/tests/list.rs b/tests/list.rs index 4d6387b..ed12465 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -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");