Add modulo operator and simplify in/not-in (#2505)

This commit is contained in:
Jonathan Turner
2020-09-07 12:12:55 +12:00
committed by GitHub
parent c973850571
commit 986b427038
7 changed files with 35 additions and 6 deletions

View File

@ -161,6 +161,18 @@ fn parens_precedence() {
assert_eq!(actual.out, "12");
}
#[test]
fn modulo() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
= 9 mod 2
"#
));
assert_eq!(actual.out, "1");
}
#[test]
fn duration_math() {
let actual = nu!(