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

Tests failing on Windows for Version 3 #180

Open
KP64 opened this issue May 26, 2023 · 1 comment
Open

Tests failing on Windows for Version 3 #180

KP64 opened this issue May 26, 2023 · 1 comment

Comments

@KP64
Copy link
Contributor

KP64 commented May 26, 2023

Tests are failing on Windows.
The OS: Windows 11
files changed after V3 release: 0
The command I've used:

cargo +nightly nextest run

Even when using the standard “test” from cargo, some tests are still failing.
This only appears to be an issue in Windows, though. I've tried it on WSL (Ubuntu) and everything worked perfectly fine.
Fail
FailSummary

@solidiquis
Copy link
Owner

Hmmm strange.. looking at the screenshot you posted it seems as though the while apparent logical size is computed on Linux is differing from how Windows computes. Here's how I'm computing logical size:

src/disk_usage/file_size/byte.rs

    pub fn init_logical(
        metadata: &Metadata,
        prefix_kind: PrefixKind,
        human_readable: bool,
    ) -> Self {
        let value = metadata.len();
        let kind = MetricKind::Logical;

        Self {
            value,
            human_readable,
            kind,
            prefix_kind,
            cached_display: RefCell::default(),
        }
    }

It's a simple call to Metadata::len which probably behaves differently for windows. Not sure what the solution to this is given that we'd probably need a windows variant for each test and I'm not a fan of that personally. Open to ideas though.

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