map equality considers both key and value
This commit is contained in:
parent
790573195f
commit
b56a4a3fcc
@ -16,8 +16,8 @@ pub(crate) struct SassMap(Vec<(Value, Value)>);
|
||||
|
||||
impl PartialEq for SassMap {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
let set_one: HashSet<&Value> = self.0.iter().map(|(v1, _)| v1).collect();
|
||||
let set_two: HashSet<&Value> = other.0.iter().map(|(v1, _)| v1).collect();
|
||||
let set_one: HashSet<&(Value, Value)> = self.0.iter().collect();
|
||||
let set_two: HashSet<&(Value, Value)> = other.0.iter().collect();
|
||||
set_one == set_two
|
||||
}
|
||||
}
|
||||
|
@ -192,3 +192,8 @@ test!(
|
||||
"a {\n color: (c: d, a: b)==(a: b, c: d);\n}\n",
|
||||
"a {\n color: true;\n}\n"
|
||||
);
|
||||
test!(
|
||||
map_equality_considers_both_key_and_value,
|
||||
"a {\n color: (a: b)==(a: c);\n}\n",
|
||||
"a {\n color: false;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user