2019-12-17 18:54:39 +00:00
|
|
|
use nu_test_support::{nu, pipeline};
|
2019-12-15 16:15:06 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn from_excel_file_to_table() {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: "tests/fixtures/formats", pipeline(
|
|
|
|
r#"
|
|
|
|
open sample_data.xlsx
|
|
|
|
| get SalesOrders
|
2022-02-09 10:58:54 +00:00
|
|
|
| get 4
|
2022-02-20 00:26:47 +00:00
|
|
|
| get column2
|
2019-12-15 16:15:06 +00:00
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
2020-05-07 11:03:43 +00:00
|
|
|
assert_eq!(actual.out, "Gill");
|
2019-12-15 16:15:06 +00:00
|
|
|
}
|
2021-06-10 12:44:24 +00: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"]
|
2022-02-04 02:01:45 +00:00
|
|
|
| columns
|
|
|
|
| get 0
|
2021-06-10 12:44:24 +00:00
|
|
|
"#
|
|
|
|
));
|
|
|
|
|
|
|
|
assert_eq!(actual.out, "SalesOrders");
|
|
|
|
}
|