containers / netavark-dhcp-proxy-deprecated

DHCP proxy for Netavark
11 stars 7 forks source link

Add tests for two identical cases #50

Closed Jackbaude closed 1 year ago

Jackbaude commented 1 year ago

Per discussion of this PR, add test cases for two identical leases that are added. Adding an identical lease should not panic and discard the identical lease.

Jackbaude commented 1 year ago

Ive looked into the implementation of HashMap::insert(), it says:

If the map did not have this key present, None is returned. If the map did have this key present, the value is updated, and the old value is returned. The key is not updated, though; this matters for types that can be == without being identical. See the module-level documentation for more.

I believe that using the insert method takes care of the logic here, and that testing is not needed. PTAL @baude

baude commented 1 year ago

no, the test is still valid