()
| 169 | /// as part of `Token::SingleQuotedString`, not as a placeholder. |
| 170 | #[test] |
| 171 | fn placeholder_inside_string_literal_untouched() { |
| 172 | let bound = bind_dsl( |
| 173 | "UPSERT INTO t (id, note) VALUES ($1, 'your $1 change')", |
| 174 | &[ParamValue::Text("abc".into())], |
| 175 | ) |
| 176 | .unwrap(); |
| 177 | assert!( |
| 178 | bound.as_str().contains("'your $1 change'"), |
| 179 | "string literal was rewritten: {}", |
| 180 | bound.as_str() |
| 181 | ); |
| 182 | assert!( |
| 183 | bound.as_str().contains("'abc'"), |
| 184 | "real placeholder not bound: {}", |
| 185 | bound.as_str() |
| 186 | ); |
| 187 | } |
| 188 | |
| 189 | #[test] |
| 190 | fn null_param() { |
nothing calls this directly
no test coverage detected