different_singulars_not_equal
This commit is contained in:
parent
32a89e4105
commit
89af9d1084
@ -261,16 +261,24 @@ mod tests {
|
||||
|
||||
fn singular_node(
|
||||
trees: &BalancedTrees<Trees>,
|
||||
key: u64,
|
||||
) -> Node<'static, TestContextPlain, AtomicObject<u64>> {
|
||||
trees
|
||||
.try_join(trees.empty(), 0.into(), trees.empty())
|
||||
.try_join(trees.empty(), key.into(), trees.empty())
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn singular_keyed(
|
||||
trees: &BalancedTrees<Trees>,
|
||||
key: u64,
|
||||
) -> Tree<'static, TestContextPlain, AtomicObject<u64>> {
|
||||
trees.tree_of(singular_node(trees, key)).unwrap()
|
||||
}
|
||||
|
||||
fn singular_tree(
|
||||
trees: &BalancedTrees<Trees>,
|
||||
) -> Tree<'static, TestContextPlain, AtomicObject<u64>> {
|
||||
trees.tree_of(singular_node(trees)).unwrap()
|
||||
singular_keyed(trees, 0)
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -304,4 +312,12 @@ mod tests {
|
||||
let reference = trees.refer(&singular_tree(&trees)).unwrap();
|
||||
assert!(trees.equal(&reference, &reference));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn different_singulars_not_equal() {
|
||||
let trees = BalancedTrees::new(new_trees());
|
||||
let reference1 = trees.refer(&singular_keyed(&trees, 1)).unwrap();
|
||||
let reference2 = trees.refer(&singular_keyed(&trees, 2)).unwrap();
|
||||
assert!(!trees.equal(&reference1, &reference2));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user