rhai/tests/bit_shift.rs

16 lines
268 B
Rust
Raw Normal View History

use rhai::Engine;
2017-11-03 17:58:51 +01:00
#[test]
fn test_left_shift() {
let mut engine = Engine::new();
assert_eq!(engine.eval::<i64>("4 << 2"), Ok(16));
2017-11-03 17:58:51 +01:00
}
#[test]
fn test_right_shift() {
let mut engine = Engine::new();
assert_eq!(engine.eval::<i64>("9 >> 1"), Ok(4));
2017-11-03 17:58:51 +01:00
}