map-values returns a comma separated list
This commit is contained in:
parent
3621363e0e
commit
c8a21f3500
@ -58,7 +58,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
|
|||||||
};
|
};
|
||||||
Ok(Value::List(
|
Ok(Value::List(
|
||||||
map.values(),
|
map.values(),
|
||||||
ListSeparator::Space,
|
ListSeparator::Comma,
|
||||||
Brackets::None,
|
Brackets::None,
|
||||||
))
|
))
|
||||||
}),
|
}),
|
||||||
|
10
tests/map.rs
10
tests/map.rs
@ -54,6 +54,16 @@ test!(
|
|||||||
"a {\n color: map-values((a: b));\n}\n",
|
"a {\n color: map-values((a: b));\n}\n",
|
||||||
"a {\n color: b;\n}\n"
|
"a {\n color: b;\n}\n"
|
||||||
);
|
);
|
||||||
|
test!(
|
||||||
|
map_values_empty,
|
||||||
|
"a {\n color: inspect(map-values(()));\n}\n",
|
||||||
|
"a {\n color: ();\n}\n"
|
||||||
|
);
|
||||||
|
test!(
|
||||||
|
map_values_are_comma_separated,
|
||||||
|
"a {\n color: map-values((a: b, c: d));\n}\n",
|
||||||
|
"a {\n color: b, d;\n}\n"
|
||||||
|
);
|
||||||
error!(
|
error!(
|
||||||
map_values_non_map,
|
map_values_non_map,
|
||||||
"a {\n color: map-values(foo);\n}\n", "Error: $map: foo is not a map."
|
"a {\n color: map-values(foo);\n}\n", "Error: $map: foo is not a map."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user