Skip to content

stdlib: the tests do not run using the prelude #8809

@amtoine

Description

@amtoine

Related problem

the tests of the standard library uses the modules (relative) paths to import required commands, e.e

use std.nu 'assert equal'

now, we have a prelude loading thanks to #8627, which loads the help commands from #8505.
things can now be imported from anywhere with

use std ...

Note
we do not need the name of the file std.nu but only the "abstract" name of the library, i.e. std[

Describe the solution you'd like

i think we should use

use std ...

in the tests not to rely on the filesystem paths.

we also need to mention in the README that, as the library is now embedded in the nu binary, we should run the tests with

cargo run -- crates/nu-std/tests.nu

to avoid using the installed nu which could be quite out of sync 🤔

Describe alternatives you've considered

No response

Additional context and details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:std-libraryDefining and improving the standard library written in Nucategory:enhancementNew feature or requesttestsissues to add tests or fix tests

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions