mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
* Update #4202: Add shift operator bshl and bshr for integers * Add more tests
This commit is contained in:
@ -25,6 +25,26 @@ fn modulo2() -> TestResult {
|
||||
run_test("5.25 mod 2", "1.25")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bshr() -> TestResult {
|
||||
run_test("16 bshr 1", "8")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bshl() -> TestResult {
|
||||
run_test("5 bshl 1", "10")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bshl_add() -> TestResult {
|
||||
run_test("2 bshl 1 + 2", "16")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sub_bshr() -> TestResult {
|
||||
run_test("10 - 2 bshr 2", "2")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn and() -> TestResult {
|
||||
run_test("true && false", "false")
|
||||
|
Reference in New Issue
Block a user