Add a test for that underflow I fixed

This commit is contained in:
John Doty 2022-12-19 19:45:07 -08:00
parent c75e684f5b
commit e0d1efb997
2 changed files with 32 additions and 0 deletions

View file

@ -15,6 +15,11 @@ pub struct ServerConfig {
}
impl ServerConfig {
#[cfg(test)]
pub fn default() -> ServerConfig {
ServerConfig { auto: true, ports: HashMap::new() }
}
pub fn contains_key(&self, port: u16) -> bool {
self.ports.contains_key(&port)
}