index() with maps
This commit is contained in:
parent
2efab1cebe
commit
f2bb6097dc
@ -221,6 +221,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
|
||||
max_args!(args, 2);
|
||||
let list = match arg!(args, 0, "list") {
|
||||
Value::List(v, ..) => v,
|
||||
Value::Map(m) => m.entries(),
|
||||
v => vec![v],
|
||||
};
|
||||
let value = arg!(args, 1, "value");
|
||||
|
@ -288,8 +288,8 @@ test!(
|
||||
"a {\n color: index(1px solid red, dashed);\n}\n",
|
||||
""
|
||||
);
|
||||
// test!(
|
||||
// index_found_map,
|
||||
// "a {\n color: index((width: 10px, height: 20px), (height 20px));\n}\n",
|
||||
// "a {\n color: 2;\n}\n"
|
||||
// );
|
||||
test!(
|
||||
index_found_map,
|
||||
"a {\n color: index((width: 10px, height: 20px), (height 20px));\n}\n",
|
||||
"a {\n color: 2;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user