Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e::equals_max_precision tests fail on i386 #182

Open
jonassmedegaard opened this issue Aug 18, 2023 · 1 comment
Open

e::equals_max_precision tests fail on i386 #182

jonassmedegaard opened this issue Aug 18, 2023 · 1 comment

Comments

@jonassmedegaard
Copy link

With release v0.28.2, two tests fail on i386:

failures:

---- values::calculation::calc::constant::e::equals_max_precision stdout ----
thread 'values::calculation::calc::constant::e::equals_max_precision' panicked at 'assertion failed: `(left == right)`
  left: `"a {\n  b: false;\n}\n"`,
 right: `"a {\n  b: true;\n}\n"`', rsass/tests/spec/values/calculation/calc/constant.rs:32:9
stack backtrace:
   0: rust_begin_unwind
             at /usr/src/rustc-1.66.0/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /usr/src/rustc-1.66.0/library/core/src/panicking.rs:65:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
             at /usr/src/rustc-1.66.0/library/core/src/panicking.rs:203:5
   4: spec::values::calculation::calc::constant::e::equals_max_precision
             at ./tests/spec/values/calculation/calc/constant.rs:32:9
   5: spec::values::calculation::calc::constant::e::equals_max_precision::{{closure}}
             at ./tests/spec/values/calculation/calc/constant.rs:31:5
   6: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.66.0/library/core/src/ops/function.rs:251:5
   7: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.66.0/library/core/src/ops/function.rs:251:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- values::calculation::calc::constant::pi::equals_max_precision stdout ----
thread 'values::calculation::calc::constant::pi::equals_max_precision' panicked at 'assertion failed: `(left == right)`
  left: `"a {\n  b: false;\n}\n"`,
 right: `"a {\n  b: true;\n}\n"`', rsass/tests/spec/values/calculation/calc/constant.rs:333:9
stack backtrace:
   0: rust_begin_unwind
             at /usr/src/rustc-1.66.0/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /usr/src/rustc-1.66.0/library/core/src/panicking.rs:65:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
             at /usr/src/rustc-1.66.0/library/core/src/panicking.rs:203:5
   4: spec::values::calculation::calc::constant::pi::equals_max_precision
             at ./tests/spec/values/calculation/calc/constant.rs:333:9
   5: spec::values::calculation::calc::constant::pi::equals_max_precision::{{closure}}
             at ./tests/spec/values/calculation/calc/constant.rs:332:5
   6: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.66.0/library/core/src/ops/function.rs:251:5
   7: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.66.0/library/core/src/ops/function.rs:251:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    values::calculation::calc::constant::e::equals_max_precision
    values::calculation::calc::constant::pi::equals_max_precision

Full build log: https://buildd.debian.org/status/fetch.php?pkg=rsass&arch=i386&ver=0.28.2-1&stamp=1691158787&raw=0

@kaj
Copy link
Owner

kaj commented Aug 20, 2023

This is similar to #168 . I'm not sure if it is a problem with 64-bit floats on a 32-bit architecture or if it may be a problem with my code for converting "text" floating point numbers to f64 floating point numbers. As I do that conversion through a num-rational value, that may also contribute.

Checking for exact equality in floating points numbers is often problematic. Maybe the tests (in sass-spec) should be modified to check that the value falls inside a suitably small range?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants