mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
BUGFIX: Found a bug in deep equality for lists :-(
This commit is contained in:
parent
544cd1572e
commit
1b45066f39
@ -80,6 +80,14 @@ assert |
|
||||
tpl4 != less;
|
||||
|;
|
||||
|
||||
assert |
|
||||
[[1, 2, [3]], 4] == [[1, 2, [3]], 4];
|
||||
|;
|
||||
|
||||
assert |
|
||||
[[1, 2, [3]], 4] != [[1, 2, [6]], 4];
|
||||
|;
|
||||
|
||||
// Expression comparisons
|
||||
assert |2 == 1+1;|;
|
||||
assert |(1+1) == 2;|;
|
||||
|
@ -22,6 +22,14 @@ assert |
|
||||
reduce identity_list_reducer.result [], list1 == list1;
|
||||
|;
|
||||
|
||||
let nested_list = {
|
||||
list = list1,
|
||||
};
|
||||
|
||||
assert |
|
||||
reduce identity_list_reducer.result [], (nested_list.list) == list1;
|
||||
|;
|
||||
|
||||
let list_reducer = macro(acc, item) => {
|
||||
result = acc + item,
|
||||
};
|
||||
|
@ -73,7 +73,9 @@ impl Val {
|
||||
Ok(false)
|
||||
} else {
|
||||
for (i, lv) in ldef.iter().enumerate() {
|
||||
lv.equal(rdef[i].as_ref(), pos.clone())?;
|
||||
if !lv.equal(rdef[i].as_ref(), pos.clone())? {
|
||||
return Ok(false);
|
||||
}
|
||||
}
|
||||
Ok(true)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user