throw an error instead of a panic if no input is provided to inspect (#9259)

# Description

This is a small PR to fix Nu crashing when calling `inspect` with no
data piped in(#9255).


# User-Facing Changes

none.
This commit is contained in:
Tilen Gimpelj
2023-05-22 20:54:04 +02:00
committed by GitHub
parent a6e455efc3
commit 60041879f3
3 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,7 @@
use nu_test_support::nu;
#[test]
fn inspect_with_empty_pipeline() {
let actual = nu!("inspect");
assert!(actual.err.contains("no input value was piped in"));
}

View File

@ -37,6 +37,7 @@ mod headers;
mod help;
mod histogram;
mod insert;
mod inspect;
mod into_filesize;
mod into_int;
mod join;