nushell: `std::tests::test_dirs::test_dirs_command` fails on MacOS
Describe the bug
the tests of #8525 do not pass.
according to the investigations of @fdncred in the comments of the PR
This is what’s going on.
> assert ($base_path == $env.DIRS_LIST.0) "list is just pwd after initialization" Error: × list is just pwd after initialization ╭─[entry #76:1:1] 1 │ assert ($base_path == $env.DIRS_LIST.0) "list is just pwd after initialization" · ────────────────┬─────────────── · ╰── It is not true. ╰────> $base_path /var/folders/m1/x0gp9jy51s146ttxtz7jlpxh0000gn/T/test_dirs_14f52f6b-23fd-4324-a29e-b7f7f0ca314d > $env.DIRS_LIST.0 /private/var/folders/m1/x0gp9jy51s146ttxtz7jlpxh0000gn/T/test_dirs_14f52f6b-23fd-4324-a29e-b7f7f0ca314d/tmp is a symlink
^ls -al /tmp lrwxr-xr-x 1 root wheel 11 Feb 9 03:39 /tmp -> private/tmp
How to reproduce
- have a Mac ( 👀 )
- run
let base_path = (($nu.temp-path) | path join $"test_dirs_(random uuid)" | path expand )
mkdir $base_path
cd $base_path
use /path/to/crates/nu-utils/standard_library/std.nu assert
assert (1 == ($env.DIRS_LIST | length))
- observe the error
Expected behavior
assert (1 == ($env.DIRS_LIST | length))
should work after any use std.nu ...
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.77.2 |
| branch | main |
| commit_hash | ef7fbf4bf9287597175b98082e5273765f828c91 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.66.1 (90743e729 2023-01-10) |
| rust_channel | 1.66.1-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.66.1 (ad779e08b 2023-01-10) |
| build_time | 2023-03-17 17:50:12 +01:00 |
| build_rust_channel | release |
| features | default, zip |
| installed_plugins | gstat |
Additional context
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24 (17 by maintainers)
Commits related to this issue
- FIX: expand all the `base_path`s in `std::test_dirs` (#8552) Related to #8525. # Description this should close #8528. # User-Facing Changes ``` $nothing ``` # Tests + Formatting ``` $nothing ``` ... — committed to nushell/nushell by amtoine a year ago
- make std.nu tests work on mac (#8576) # Description This PR is to make test_dirs.nu work better on macos. closes #8528 # User-Facing Changes _(List of all changes that impact the user exp... — committed to nushell/nushell by fdncred a year ago
i’ll try to fix #8525 tonight 👍
After talking about this in our meeting today, we do not want to disable any tests, but we want to fix the problems that we find because that just makes the language better. I think we need to fix
path joinso that it expands.