diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46a358667..b0fa433ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,7 +116,7 @@ jobs: run: cargo install --path . --locked --no-default-features - name: Standard library tests - run: nu -c 'use std run-tests; run-tests --path crates/nu-std' + run: nu -c 'use std; std testing run --path crates/nu-std' - name: Setup Python uses: actions/setup-python@v4 diff --git a/crates/nu-std/README.md b/crates/nu-std/README.md index 7f6f2e575..479ba38c0 100644 --- a/crates/nu-std/README.md +++ b/crates/nu-std/README.md @@ -31,7 +31,7 @@ use std ### :test_tube: run the tests the following call should return no errors ```bash -NU_LOG_LEVEL=DEBUG cargo run -- -c "use std run-tests; run-tests --path crates/nu-std" +NU_LOG_LEVEL=DEBUG cargo run -- -c "use std; std testing run --path crates/nu-std" ``` > **Warning** diff --git a/crates/nu-std/lib/mod.nu b/crates/nu-std/lib/mod.nu index a3721ee0c..3d9089dea 100644 --- a/crates/nu-std/lib/mod.nu +++ b/crates/nu-std/lib/mod.nu @@ -7,6 +7,7 @@ export-env { } export use help * export use log * +export use testing * export use xml * # Add the given paths to the PATH. diff --git a/crates/nu-std/lib/testing.nu b/crates/nu-std/lib/testing.nu index 17539b1a0..1483ffef2 100644 --- a/crates/nu-std/lib/testing.nu +++ b/crates/nu-std/lib/testing.nu @@ -41,7 +41,7 @@ def throw-error [error: record] { # Run Nushell tests # # It executes exported "test_*" commands in "test_*" modules -export def run-tests [ +export def 'testing run' [ --path: path, # Path to look for tests. Default: current directory. --module: string, # Module to run tests. Default: all test modules found. --command: string, # Test command to run. Default: all test command found in the files. diff --git a/crates/nu-std/src/lib.rs b/crates/nu-std/src/lib.rs index 996683e91..4a4ef384d 100644 --- a/crates/nu-std/src/lib.rs +++ b/crates/nu-std/src/lib.rs @@ -76,6 +76,7 @@ pub fn load_standard_library( // the rest of the library ("dirs", include_str!("../lib/dirs.nu")), ("help", include_str!("../lib/help.nu")), + ("testing", include_str!("../lib/testing.nu")), ("xml", include_str!("../lib/xml.nu")), ]; diff --git a/toolkit.nu b/toolkit.nu index 13f338f48..577dd7a75 100644 --- a/toolkit.nu +++ b/toolkit.nu @@ -37,7 +37,7 @@ export def test [ # run the tests for the standard library export def "test stdlib" [] { - cargo run -- -c "use std run-tests; run-tests --path crates/nu-std" + cargo run -- -c "use std; std testing run --path crates/nu-std" } # print the pipe input inside backticks, dimmed and italic, as a pretty command