Add tests for from_bits.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
This commit is contained in:
OGINO Masanori 2014-05-13 23:12:55 +09:00 committed by Alex Crichton
parent 24ece07cec
commit de2c48c30a

View file

@ -207,6 +207,13 @@ mod tests {
assert_eq!(FlagABC.bits(), 0x00000111);
}
#[test]
fn test_from_bits() {
assert!(unsafe { Flags::from_bits(0x00000000) } == Flags::empty());
assert!(unsafe { Flags::from_bits(0x00000001) } == FlagA);
assert!(unsafe { Flags::from_bits(0x00000111) } == FlagABC);
}
#[test]
fn test_is_empty(){
assert!(Flags::empty().is_empty());