mac: Add test for MacAddress::from_string
parent
c0b462d8ac
commit
e3e4c39f21
12
src/mac.rs
12
src/mac.rs
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue