From 5cf6dea9976ff969bfeb6c8042181d51a58597ac Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Wed, 8 Jan 2025 18:24:31 -0500 Subject: [PATCH] Remove file accidentally re-introduced by merge (#14785) # Description Re-removes the tests for `split_by`, which was removed in #14726 and accidentally re-introduced by #14741 cc @fdncred # User-Facing Changes N/A # Tests + Formatting N/A # After Submitting N/A --- crates/nu-command/tests/commands/split_by.rs | 61 -------------------- 1 file changed, 61 deletions(-) delete mode 100644 crates/nu-command/tests/commands/split_by.rs diff --git a/crates/nu-command/tests/commands/split_by.rs b/crates/nu-command/tests/commands/split_by.rs deleted file mode 100644 index a458a01a25..0000000000 --- a/crates/nu-command/tests/commands/split_by.rs +++ /dev/null @@ -1,61 +0,0 @@ -use nu_test_support::fs::Stub::EmptyFile; -use nu_test_support::playground::Playground; -use nu_test_support::{nu, pipeline}; - -#[test] -fn splits() { - let sample = r#" - [[first_name, last_name, rusty_at, type]; - [Andrés, Robalino, "10/11/2013", A], - [JT, Turner, "10/12/2013", B], - [Yehuda, Katz, "10/11/2013", A]] - "#; - - let actual = nu!(pipeline(&format!( - r#" - {sample} - | group-by rusty_at - | split-by type - | get A."10/11/2013" - | length - "# - ))); - - assert_eq!(actual.out, "2"); -} - -#[test] -fn errors_if_no_input() { - Playground::setup("split_by_no_input", |dirs, _sandbox| { - let actual = nu!(cwd: dirs.test(), pipeline("split-by type")); - - assert!(actual.err.contains("no input value was piped in")); - }) -} - -#[test] -fn errors_if_non_record_input() { - Playground::setup("split_by_test_2", |dirs, sandbox| { - sandbox.with_files(&[ - EmptyFile("los.txt"), - EmptyFile("tres.txt"), - EmptyFile("amigos.txt"), - EmptyFile("arepas.clu"), - ]); - - let input_mismatch = nu!(cwd: dirs.test(), pipeline("5 | split-by type")); - - assert!(input_mismatch.err.contains("doesn't support int input")); - - let only_supports = nu!( - cwd: dirs.test(), pipeline( - " - ls - | get name - | split-by type - " - )); - - assert!(only_supports.err.contains("Input type not supported")); - }) -}