2019-12-17 19:54:39 +01:00
|
|
|
use nu_test_support::{nu, pipeline};
|
2019-12-15 17:15:06 +01:00
|
|
|
|
|
|
|
#[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
|
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
2020-05-07 13:03:43 +02:00
|
|
|
assert_eq!(actual.out, "Gill");
|
2019-12-15 17:15:06 +01:00
|
|
|
}
|
2021-06-10 14:44:24 +02:00
|
|
|
|
|
|
|
#[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"]
|
|
|
|
| get
|
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
|
|
|
assert_eq!(actual.out, "SalesOrders");
|
|
|
|
}
|