Add binary literals (#4680)

This commit is contained in:
JT
2022-02-28 18:31:53 -05:00
committed by GitHub
parent e3100e6afd
commit a6a96b29cb
15 changed files with 199 additions and 10 deletions

View File

@ -102,3 +102,27 @@ fn to_nuon_records() {
assert_eq!(actual.out, "true");
}
#[test]
fn binary_to() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
0x[ab cd ef] | to nuon
"#
));
assert_eq!(actual.out, "0x[ABCDEF]");
}
#[test]
fn binary_roundtrip() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
"0x[1f ff]" | from nuon | to nuon
"#
));
assert_eq!(actual.out, "0x[1FFF]");
}