()
| 20 | |
| 21 | // This test assumes put/size/containsKey/get are implemented properly. |
| 22 | @Test |
| 23 | public void sanityClearTest() { |
| 24 | BSTMap<String, Integer> b = new BSTMap<>(); |
| 25 | for (int i = 0; i < 455; i++) { |
| 26 | b.put("hi" + i, 1+i); |
| 27 | //make sure put is working via containsKey and get |
| 28 | assertThat(b.get("hi" + i)).isEqualTo(1 + i); |
| 29 | assertThat(b.containsKey("hi" + i)).isTrue(); |
| 30 | } |
| 31 | assertThat(b.size()).isEqualTo(455); |
| 32 | b.clear(); |
| 33 | assertThat(b.size()).isEqualTo(0); |
| 34 | for (int i = 0; i < 455; i++) { |
| 35 | assertThat(b.get("hi" + i)).isNull(); |
| 36 | assertThat(b.containsKey("hi" + i)).isFalse(); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // Assumes `put` is implemented properly. |
| 41 | @Test |
nothing calls this directly
no test coverage detected