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

  1. have a Mac ( 👀 )
  2. 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))
  1. 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

Most upvoted comments

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 join so that it expands.