MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / test_get_with_default

Function test_get_with_default

rust/tests/bplus_tree.rs:100–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99#[test]
100fn test_get_with_default() {
101 let mut tree = create_tree_4();
102 tree.insert(1, "one".to_string());
103
104 assert_eq!(tree.get(&1), Some(&"one".to_string()));
105 assert_eq!(tree.get(&2), None);
106 assert_eq!(
107 tree.get_or_default(&2, &"default".to_string()),
108 &"default".to_string()
109 );
110 assert_invariants(&tree, "get with default");
111}
112
113// ============================================================================
114// TRANSLATED PYTHON TESTS - Splitting Operations

Callers

nothing calls this directly

Calls 3

create_tree_4Function · 0.85
assert_invariantsFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected