Skip to content

Commit

Permalink
Re-order add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alnoki committed Nov 4, 2024
1 parent 0462bc7 commit 452c588
Showing 1 changed file with 42 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -796,47 +796,7 @@ module red_black_map::red_black_map {
}

#[test]
#[expected_failure(abort_code = E_KEY_NOT_FOUND)]
fun test_borrow_mut_not_found(): Map<u256> {
let map = new();
map.borrow_mut(0);
map
}

#[test]
#[expected_failure(abort_code = E_KEY_NOT_FOUND)]
fun test_borrow_not_found(): Map<u256> {
let map = new();
map.borrow(0);
map
}

#[test]
#[expected_failure(abort_code = E_EMPTY)]
fun test_maximum_key_empty(): Map<u256> {
let map = new();
map.maximum_key();
map
}

#[test]
#[expected_failure(abort_code = E_EMPTY)]
fun test_minimum_key_empty(): Map<u256> {
let map = new();
map.minimum_key();
map
}

#[test]
#[expected_failure(abort_code = E_KEY_NOT_FOUND)]
fun test_remove_key_not_found(): Map<u256> {
let map = set_up_tree_1();
map.remove(0);
map
}

#[test]
fun test_sequence_1(): Map<u256> {
fun test_add_sequence_1(): Map<u256> {
let map = new();
assert!(map.length() == 0);
assert!(map.keys() == vector[]);
Expand Down Expand Up @@ -1136,7 +1096,7 @@ module red_black_map::red_black_map {
}

#[test]
fun test_sequence_2(): Map<u256> {
fun test_add_sequence_2(): Map<u256> {
let map = new();

// Initialize root: insert 50.
Expand Down Expand Up @@ -1351,6 +1311,46 @@ module red_black_map::red_black_map {
map
}

#[test]
#[expected_failure(abort_code = E_KEY_NOT_FOUND)]
fun test_borrow_mut_not_found(): Map<u256> {
let map = new();
map.borrow_mut(0);
map
}

#[test]
#[expected_failure(abort_code = E_KEY_NOT_FOUND)]
fun test_borrow_not_found(): Map<u256> {
let map = new();
map.borrow(0);
map
}

#[test]
#[expected_failure(abort_code = E_EMPTY)]
fun test_maximum_key_empty(): Map<u256> {
let map = new();
map.maximum_key();
map
}

#[test]
#[expected_failure(abort_code = E_EMPTY)]
fun test_minimum_key_empty(): Map<u256> {
let map = new();
map.minimum_key();
map
}

#[test]
#[expected_failure(abort_code = E_KEY_NOT_FOUND)]
fun test_remove_key_not_found(): Map<u256> {
let map = set_up_tree_1();
map.remove(0);
map
}

#[test]
#[expected_failure(abort_code = E_KEY_NOT_FOUND)]
fun test_traverse_predecessor_key_not_found(): Map<u256> {
Expand Down

0 comments on commit 452c588

Please sign in to comment.