isaacholt100 / bnum

Arbitrary, fixed size numeric types that extend the functionality of primitive numeric types in Rust.
https://crates.io/crates/bnum
Other
67 stars 8 forks source link

Test failures / Cargo test not run in CI #16

Closed jkilpatr closed 1 year ago

jkilpatr commented 1 year ago

Currently on master the following tests fail

failures:
    src/buint/endian.rs - buint::endian::BUint<N>::from_be_slice (line 315)
    src/buint/endian.rs - buint::endian::BUint<N>::from_le_slice (line 315)
    src/buint/endian.rs - buint::endian::BUintD16<N>::from_be_slice (line 315)
    src/buint/endian.rs - buint::endian::BUintD16<N>::from_le_slice (line 315)
    src/buint/endian.rs - buint::endian::BUintD32<N>::from_be_slice (line 315)
    src/buint/endian.rs - buint::endian::BUintD32<N>::from_le_slice (line 315)
    src/buint/endian.rs - buint::endian::BUintD8<N>::from_be_slice (line 315)
    src/buint/endian.rs - buint::endian::BUintD8<N>::from_le_slice (line 315)
isaacholt100 commented 1 year ago

@jkilpatr Hi, thanks very much for creating this issue. Would you be able to let me know if the failures display any information about which inputs caused the tests to fail? These tests are currently passing on my machine so I'm sure that the failures will be down to some specific edge cases which quickcheck is rarely passing as inputs. Thanks.

isaacholt100 commented 1 year ago

Also, could you let me know which of the crate features you are using please, just in case it's something to do with that?

isaacholt100 commented 1 year ago

Ah sorry I've just realised these are doc tests, not lib tests, that are failing, right? In which case, are they failing because of an assertion error or because the tests failed to compile?

isaacholt100 commented 1 year ago

Never mind, I've figured out what the problem was: I was using the from_be_bytes and from_le_bytes methods on U128 in the examples, but these are only available on nightly. I have fixed this and updated the code in master. Thanks again!

jkilpatr commented 1 year ago

Thanks for the quick response here! I really appreciate it.

Have you considered adding the unit tests to GitHub actions so that they run all the time? I'll try to open a pr for it today it's just a few lines.

jkilpatr commented 1 year ago

Ah I see I was wrong, for some reason the tests didn't fail in CI. I can confirm everything works perfectly in my setup now and the issue is resolved. Thanks again!

isaacholt100 commented 1 year ago

Thanks for the quick response here! I really appreciate it.

Have you considered adding the unit tests to GitHub actions so that they run all the time? I'll try to open a pr for it today it's just a few lines.

I have a GitHub actions file setup if that’s what you mean?

isaacholt100 commented 1 year ago

Ah I see I was wrong, for some reason the tests didn't fail in CI. I can confirm everything works perfectly in my setup now and the issue is resolved. Thanks again!

No worries, good to hear!