mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 17:33:12 +02:00
More nuon tests, fix table print (#4762)
This commit is contained in:
@ -126,3 +126,39 @@ fn binary_roundtrip() {
|
||||
|
||||
assert_eq!(actual.out, "0x[1FFF]");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn read_binary_data() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open sample.nuon | get 5.3
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "31")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn read_record() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open sample.nuon | get 4.name
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "Bobby")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn read_bool() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open sample.nuon | get 3 | $in == $true
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "true")
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ pub fn get_columns(input: &[Value]) -> Vec<String> {
|
||||
columns.push(col.to_string());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return vec![];
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user