Skip to content

Commit

Permalink
bugfix: fixes not operator creates invalid types
Browse files Browse the repository at this point in the history
* fixes Not implementations creating types with
  out-of-bounds representations
  • Loading branch information
Ben Leadbetter committed Dec 22, 2023
1 parent 54c7e61 commit 854d7bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,4 +970,9 @@ mod tests {
assert_eq!(!u7(0), u7(0x7F));
assert_eq!(!u7(56), u7(71));
}

#[test]
fn test_not_creates_valid_repr() {
assert_eq!((!u4(0b0101)).0, 0b1010);
}
}

0 comments on commit 854d7bc

Please sign in to comment.