We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 026dbc8 commit 67963d7Copy full SHA for 67963d7
1 file changed
src/data_structures/binary_search_tree.rs
@@ -250,6 +250,13 @@ mod test {
250
);
251
assert!(!tree.search(&"only a sith deals in absolutes"));
252
assert!(!tree.search(&"you underestimate my power"));
253
+ assert!(!tree.search(&"apple pie"));
254
+
255
+ let empty_tree = BinarySearchTree::<i32>::new();
256
+ assert!(!empty_tree.search(&12));
257
+ assert!(!empty_tree.search(&-5));
258
+ assert!(!empty_tree.search(&0));
259
+ assert!(!empty_tree.search(&5));
260
}
261
262
#[test]
@@ -316,6 +323,10 @@ mod test {
316
323
"your move"
317
324
318
325
assert!(tree.ceil(&"your new empire").is_none());
326
327
328
+ assert!(empty_tree.floor(&12).is_none());
329
+ assert!(empty_tree.ceil(&12).is_none());
319
330
320
331
321
332
0 commit comments