mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Add band
and bor
operator for bit operations (#5936)
* Add `band` and `bor` Operator * Add tests
This commit is contained in:
@ -55,6 +55,21 @@ fn or() -> TestResult {
|
||||
run_test("true || false", "true")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn band() -> TestResult {
|
||||
run_test("2 band 4", "0")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bor() -> TestResult {
|
||||
run_test("2 bor 4", "6")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bit_and_or() -> TestResult {
|
||||
run_test("2 bor 4 band 1 + 2", "2")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pow() -> TestResult {
|
||||
run_test("3 ** 3", "27")
|
||||
|
Reference in New Issue
Block a user