change 0.1+0.2 test into 0.3 as limbo does not yet support decimals

This commit is contained in:
alpaylan
2024-12-11 16:32:06 -05:00
parent da28ed51ca
commit 021456326e
2 changed files with 10 additions and 9 deletions

View File

@@ -4282,13 +4282,14 @@ mod tests {
expected_str
);
// let input_str = OwnedValue::Text(Rc::new(String::from("tes3")));
// let pattern_str = OwnedValue::Integer(3);
// let replace_str = OwnedValue::Agg(Box::new(AggContext::Sum(OwnedValue::Float(0.1 + 0.2))));
// let expected_str = OwnedValue::Text(Rc::new(String::from("tes0.3")));
// assert_eq!(
// exec_replace(&input_str, &pattern_str, &replace_str),
// expected_str
// );
// todo: change this test to use (0.1 + 0.2) instead of 0.3 when decimals are implemented.
let input_str = OwnedValue::Text(Rc::new(String::from("tes3")));
let pattern_str = OwnedValue::Integer(3);
let replace_str = OwnedValue::Agg(Box::new(AggContext::Sum(OwnedValue::Float(0.3))));
let expected_str = OwnedValue::Text(Rc::new(String::from("tes0.3")));
assert_eq!(
exec_replace(&input_str, &pattern_str, &replace_str),
expected_str
);
}
}

View File

@@ -164,7 +164,7 @@ do_execsql_test replace {
} {example}
do_execsql_test replace-number {
select replace('tes3', 3, 0.1 + 0.2)
select replace('tes3', 3, 0.3)
} {tes0.3}
do_execsql_test replace-null {