diff --git a/src/value/mod.rs b/src/value/mod.rs index 075e449..596b9e4 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -291,6 +291,14 @@ impl Value { )), Value::Dimension(num, unit) => Cow::owned(format!("{}{}", num, unit)), Value::ArgList(args) if args.is_empty() => Cow::const_str("()"), + Value::ArgList(args) if args.len() == 1 => Cow::owned(format!( + "({},)", + args.iter() + .filter(|x| !x.is_null()) + .map(|a| Ok(a.node.inspect(span)?)) + .collect::>>>()? + .join(", "), + )), Value::ArgList(args) => Cow::owned( args.iter() .filter(|x| !x.is_null()) diff --git a/tests/arglist.rs b/tests/arglist.rs index 83b02ca..b452036 100644 --- a/tests/arglist.rs +++ b/tests/arglist.rs @@ -62,3 +62,14 @@ test!( }", "a {\n color: null;\n}\n" ); +test!( + inspect_arglist_with_one_arg, + "@function foo($a...) { + @return inspect($a); + } + + a { + color: inspect(foo(1)); + }", + "a {\n color: (1,);\n}\n" +); diff --git a/tests/inspect.rs b/tests/inspect.rs index a89b8f4..136d11b 100644 --- a/tests/inspect.rs +++ b/tests/inspect.rs @@ -129,5 +129,5 @@ test!( a { color: foo((a: b)); }", - "a {\n color: (a: b);\n}\n" + "a {\n color: ((a: b),);\n}\n" );