forked from extern/nushell
Add 'and' and 'or' operators (#5297)
This commit is contained in:
parent
2a18206771
commit
ee29a15119
@ -4000,8 +4000,8 @@ pub fn parse_operator(
|
|||||||
b"in" => Operator::In,
|
b"in" => Operator::In,
|
||||||
b"not-in" => Operator::NotIn,
|
b"not-in" => Operator::NotIn,
|
||||||
b"mod" => Operator::Modulo,
|
b"mod" => Operator::Modulo,
|
||||||
b"&&" => Operator::And,
|
b"&&" | b"and" => Operator::And,
|
||||||
b"||" => Operator::Or,
|
b"||" | b"or" => Operator::Or,
|
||||||
b"**" => Operator::Pow,
|
b"**" => Operator::Pow,
|
||||||
_ => {
|
_ => {
|
||||||
return (
|
return (
|
||||||
|
@ -409,3 +409,8 @@ fn unary_not_6() -> TestResult {
|
|||||||
fn date_literal() -> TestResult {
|
fn date_literal() -> TestResult {
|
||||||
run_test(r#"2022-09-10 | date to-record | get day"#, "10")
|
run_test(r#"2022-09-10 | date to-record | get day"#, "10")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn and_and_or() -> TestResult {
|
||||||
|
run_test(r#"true and false or true"#, "true")
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user