mac: Add test for MacAddress::from_string

master
Dustin 2018-09-19 22:38:55 -05:00
parent c0b462d8ac
commit e3e4c39f21
1 changed files with 12 additions and 0 deletions

View File

@ -22,3 +22,15 @@ impl MacAddress {
&self.addr
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_mac_from_string() {
let mac = MacAddress::from_string("a:bb:cc:dd:ee:ff").unwrap();
assert_eq!(&[0xa, 0xbb, 0xcc, 0xdd, 0xee, 0xff], mac.as_bytes());
}
}