-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement REPEAT Function #352
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good!
I left just tiny comments here.
Let's merge this into the main soon 👍
src/executor/evaluate/mod.rs
Outdated
Nullable::Null => { | ||
return Ok(Evaluated::from(Value::Null)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just have a single more test case.
Precisely, this Nullable::Null
is not tested by current repeat
integration test
Codecov Report
@@ Coverage Diff @@
## main #352 +/- ##
==========================================
+ Coverage 91.71% 91.73% +0.02%
==========================================
Files 138 139 +1
Lines 8434 8460 +26
==========================================
+ Hits 7735 7761 +26
Misses 699 699
Continue to review full report at Codecov.
|
src/executor/evaluate/mod.rs
Outdated
Function::Repeat { expr, num } => { | ||
let expr = eval_to_str!(expr); | ||
let num = eval_to_integer!(num); | ||
Ok(Value::Str(expr.repeat(num.try_into().unwrap()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to use unwrap()
.
num.try_into()?
will work.
src/tests/function/repeat.rs
Outdated
use crate::*; | ||
|
||
test_case!(repeat, async move { | ||
//use Value::{Null, Str, I64}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👍 👍 👍
Good start!
All looks good, merging!
No description provided.