Skip to content

Commit

Permalink
Add tests for from_bits.
Browse files Browse the repository at this point in the history
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
  • Loading branch information
omasanori authored and alexcrichton committed May 14, 2014
1 parent 24ece07 commit de2c48c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libstd/bitflags.rs
Expand Up @@ -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());
Expand Down

0 comments on commit de2c48c

Please sign in to comment.