From 612e0e21602f55092bc121bfd07f7c3bf5119e4f Mon Sep 17 00:00:00 2001 From: NotTheDr01ds <32344964+NotTheDr01ds@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:53:33 -0400 Subject: [PATCH] Fix exports and resulting test case --- crates/nu-std/std/mod.nu | 26 +++++++++--------------- crates/nu-std/tests/test_std_postload.nu | 4 ++-- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/crates/nu-std/std/mod.nu b/crates/nu-std/std/mod.nu index 72839279e6..c0d49d1685 100644 --- a/crates/nu-std/std/mod.nu +++ b/crates/nu-std/std/mod.nu @@ -1,19 +1,19 @@ # std.nu, `used` to load all standard library components +# Top-level commands: ellie, repeat, null-device, and "path add" +export use lib * + +# std submodules +export module assert +export module bench +export module dt +export module formats export module help export module input export module iter export module log -export module assert - -# Allow use of non-prefixed commands -# from these submodules when `use std *` -export use lib * -export use bench * -export use dt * -export use formats * -export use xml * -export use math * +export module math +export module xml # Load main dirs command and all subcommands export use dirs main @@ -26,9 +26,3 @@ export module dirs { goto ] } - -# Backward compatibility -# Allow, for example, `formats to jsonl` -export module xml -export module formats -export module dt \ No newline at end of file diff --git a/crates/nu-std/tests/test_std_postload.nu b/crates/nu-std/tests/test_std_postload.nu index 5ba944e0d3..6b1352350e 100644 --- a/crates/nu-std/tests/test_std_postload.nu +++ b/crates/nu-std/tests/test_std_postload.nu @@ -6,6 +6,6 @@ def std_post_import [] { assert length (scope commands | where name == "path add") 1 assert length (scope commands | where name == "ellie") 1 assert length (scope commands | where name == "repeat") 1 - assert length (scope commands | where name == "from jsonl") 1 - assert length (scope commands | where name == "datetime-diff") 1 + assert length (scope commands | where name == "formats from jsonl") 1 + assert length (scope commands | where name == "dt datetime-diff") 1 } \ No newline at end of file