From 021456326efb3a4adda91a8572ad2ededec0fa49 Mon Sep 17 00:00:00 2001 From: alpaylan Date: Wed, 11 Dec 2024 16:32:06 -0500 Subject: [PATCH] change 0.1+0.2 test into 0.3 as limbo does not yet support decimals --- core/vdbe/mod.rs | 17 +++++++++-------- testing/scalar-functions.test | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/vdbe/mod.rs b/core/vdbe/mod.rs index 75ca713da..23f7d3bd6 100644 --- a/core/vdbe/mod.rs +++ b/core/vdbe/mod.rs @@ -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 + ); } } diff --git a/testing/scalar-functions.test b/testing/scalar-functions.test index 5dcec1e8f..c2be07fb9 100755 --- a/testing/scalar-functions.test +++ b/testing/scalar-functions.test @@ -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 {