use rbs::Value;
use rbatis_codegen::ops::Not;
#[test]
fn test_value_not() {
assert_eq!(Value::Bool(true).op_not(), Value::Bool(false));
assert_eq!(Value::Bool(false).op_not(), Value::Bool(true));
assert_eq!(Value::I32(5).op_not(), Value::I32(!5)); assert_eq!(Value::I64(10).op_not(), Value::I64(!10)); assert_eq!(Value::U32(15).op_not(), Value::U32(!15)); assert_eq!(Value::U64(20).op_not(), Value::U64(!20));
assert_eq!(Value::I32(5).op_not().op_not(), Value::I32(5));
assert_eq!(Value::Bool(true).op_not().op_not(), Value::Bool(true));
}
#[test]
fn test_value_ref_not() {
let v1 = Value::I32(5);
let v2 = Value::Bool(true);
let v3 = Value::U32(15);
assert_eq!((&v1).op_not(), Value::I32(!5)); assert_eq!((&v2).op_not(), Value::Bool(false));
assert_eq!((&v3).op_not(), Value::U32(!15));
assert_eq!((&&v1).op_not(), Value::I32(!5));
assert_eq!((&&v2).op_not(), Value::Bool(false));
}