From b9643478959d1c260057cea04583063a34aa2c6f Mon Sep 17 00:00:00 2001 From: Antoine Stevan <44101798+amtoine@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:10:34 +0200 Subject: [PATCH] add a test to make sure "nothing" shows up as "nothing" in help (#9941) related to - https://github.com/nushell/nushell/pull/9935 # Description this PR just adds a test to make sure type annotations in `def`s show as `nothing` in the help pages of commands. # User-Facing Changes # Tests + Formatting adds a new test `nothing_type_annotation`. # After Submitting --- crates/nu-command/tests/commands/help.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/nu-command/tests/commands/help.rs b/crates/nu-command/tests/commands/help.rs index cad6aeab2f..32e01c1c0f 100644 --- a/crates/nu-command/tests/commands/help.rs +++ b/crates/nu-command/tests/commands/help.rs @@ -380,3 +380,14 @@ fn help_alias_before_command() { assert!(actual.out.contains("Alias")); } + +#[test] +fn nothing_type_annotation() { + let actual = nu!(pipeline( + " + def foo []: nothing -> nothing {}; + help commands | where name == foo | get input_output.0.output.0 + " + )); + assert_eq!(actual.out, "nothing"); +}