bcmyers / num-format

A Rust crate for producing string representations of numbers, formatted according to international standards
Apache License 2.0
122 stars 22 forks source link

test_non_zero_usize fails on 32 bit architectures #26

Open davide125 opened 2 years ago

davide125 commented 2 years ago

On armv7hl (but the repro is the same on i686):

$ cargo test
[...]
running 6 tests
test test_non_zero_u16 ... ok
test test_non_zero_u32 ... ok
test test_non_zero_u128 ... ok
test test_non_zero_u8 ... ok
test test_non_zero_usize ... FAILED
test test_non_zero_u64 ... ok

failures:

---- test_non_zero_usize stdout ----
thread 'test_non_zero_usize' panicked at 'assertion failed: `(left == right)`
  left: `"18,446,744,073,709,551,615"`,
 right: `"4,294,967,295"`', num-format/tests/test_non_zero.rs:192:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    test_non_zero_usize

test result: FAILED. 5 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
plugwash commented 2 years ago

I just fixed this in Debian, a patch can be found at https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/num-format/debian/patches/fix-tests-32-bit.diff