Skip to content

Commit

Permalink
Fix assert! macro usage
Browse files Browse the repository at this point in the history
There is a bug in rustc that allows adding invalid trailing tokens to
the `assert!` macro call. They are currently ignored but are going to
produce errors in the future.

Fix assert! macro usage to add missing comma.

For more information, see
rust-lang/rust#60024 and
rust-lang/rust#60039
  • Loading branch information
rasendubi committed Apr 25, 2019
1 parent 5c7c4e0 commit e8dbb9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ fn test_hexadecimal_decimal() {
assert_eq!(hexadecimal_decimal(b"0007".to_vec()).unwrap(), 7);
assert_eq!(hexadecimal_decimal(b"00000001".to_vec()).unwrap(), 1);
assert_eq!(hexadecimal_decimal(b"0100".to_vec()).unwrap(), 256);
assert!(hexadecimal_decimal(b"0".to_vec()).is_err() "Must have even number of hex chars");
assert!(hexadecimal_decimal(b"000".to_vec()).is_err() "Must have even number of hex chars");
assert!(hexadecimal_decimal(b"00000".to_vec()).is_err() "Must have even number of hex chars");
assert!(hexadecimal_decimal(b"0".to_vec()).is_err(), "Must have even number of hex chars");
assert!(hexadecimal_decimal(b"000".to_vec()).is_err(), "Must have even number of hex chars");
assert!(hexadecimal_decimal(b"00000".to_vec()).is_err(), "Must have even number of hex chars");
assert!(
hexadecimal_decimal(b"1122334455667788A".to_vec()).is_err(),
"Max 16 hex chars can be parsed"
Expand Down

0 comments on commit e8dbb9c

Please sign in to comment.