mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Command tests (#922)
* WIP command tests * Finish marking todo tests * update * update * Windows cd test ignoring
This commit is contained in:
31
crates/nu-command/tests/format_conversions/xlsx.rs
Normal file
31
crates/nu-command/tests/format_conversions/xlsx.rs
Normal file
@ -0,0 +1,31 @@
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[test]
|
||||
fn from_excel_file_to_table() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open sample_data.xlsx
|
||||
| get SalesOrders
|
||||
| nth 4
|
||||
| get Column2
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "Gill");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn from_excel_file_to_table_select_sheet() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open sample_data.xlsx --raw
|
||||
| from xlsx -s ["SalesOrders"]
|
||||
| columns
|
||||
| get 0
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "SalesOrders");
|
||||
}
|
Reference in New Issue
Block a user