chore: split tests for...
merge query with params function
This commit is contained in:
parent
a4d8218307
commit
a5b3d33bef
1 changed files with 7 additions and 1 deletions
|
@ -42,17 +42,23 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn merge_query_with_params_successfully() {
|
fn replace_one_param_in_query() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
merge_query_with_params("SELECT $1", &[&"foo"]),
|
merge_query_with_params("SELECT $1", &[&"foo"]),
|
||||||
"SELECT 'foo'"
|
"SELECT 'foo'"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn replace_two_params_in_query() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
merge_query_with_params("SELECT $1, $2", &[&"foo", &"bar"]),
|
merge_query_with_params("SELECT $1, $2", &[&"foo", &"bar"]),
|
||||||
"SELECT 'foo', 'bar'"
|
"SELECT 'foo', 'bar'"
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn replace_all_bonds_in_query_with_first_param() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
merge_query_with_params("SELECT $1, $1", &[&"foo"]),
|
merge_query_with_params("SELECT $1, $1", &[&"foo"]),
|
||||||
"SELECT 'foo', 'foo'"
|
"SELECT 'foo', 'foo'"
|
||||||
|
|
Reference in a new issue