Skip to content

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

Closed

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

Activity

  1. added
    category:enhancement
    on Apr 8, 2023
  2. added
    tests
    A:std-library
    on Apr 8, 2023
  3. added a commit that references this issue on Apr 8, 2023
    d128c0e
  4. added this to the v0.79.0 milestone on Apr 11, 2023
  5. added a commit that references this issue on Apr 12, 2023
    2393d2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:std-librarycategory:enhancementtests

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions