Add hex, octal, binary (#3562)

This commit is contained in:
JT
2021-06-06 17:14:51 +12:00
committed by GitHub
parent 995dbd25b3
commit a2e6f5ebdb
2 changed files with 85 additions and 5 deletions

View File

@ -529,6 +529,39 @@ fn block_params_override_correct() {
assert_eq!(actual.out, "[1,2,3]");
}
#[test]
fn hex_number() {
let actual = nu!(
cwd: ".",
r#"
0x10
"#
);
assert_eq!(actual.out, "16");
}
#[test]
fn binary_number() {
let actual = nu!(
cwd: ".",
r#"
0b10
"#
);
assert_eq!(actual.out, "2");
}
#[test]
fn octal_number() {
let actual = nu!(
cwd: ".",
r#"
0o10
"#
);
assert_eq!(actual.out, "8");
}
#[test]
fn run_dynamic_blocks() {
let actual = nu!(