Skip to content

Commit e31506a

Browse files
committed
refactor: make indentation clear by using arrays
1 parent 70d02b0 commit e31506a

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

query/tests/integration.rs

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -289,17 +289,18 @@ EXPLAIN SELECT add_one(1);
289289

290290
#[tokio::test(flavor = "multi_thread")]
291291
async fn test_strip_indentation_everything_indented() {
292-
let query = r#"
293-
CREATE FUNCTION add_one()
294-
LANGUAGE python
295-
AS '
296-
def add_one(x: int) -> int:
297-
298-
return x + 1
299-
';
300-
301-
SELECT add_one(1);
302-
"#;
292+
let query_lines = &[
293+
" CREATE FUNCTION add_one()",
294+
" LANGUAGE python",
295+
" AS '",
296+
" def add_one(x: int) -> int:",
297+
" ",
298+
" return x + 1",
299+
" ';",
300+
" ",
301+
" SELECT add_one(1);",
302+
];
303+
let query = query_lines.join("\n");
303304

304305
let ctx = SessionContext::new();
305306
let component = python_component().await;
@@ -334,17 +335,18 @@ async fn test_strip_indentation_everything_indented() {
334335

335336
#[tokio::test(flavor = "multi_thread")]
336337
async fn test_strip_indentation_empty_lines_not_indented() {
337-
let query = r#"
338-
CREATE FUNCTION add_one()
339-
LANGUAGE python
340-
AS '
341-
def add_one(x: int) -> int:
342-
343-
return x + 1
344-
';
345-
346-
SELECT add_one(1);
347-
"#;
338+
let query_lines = &[
339+
" CREATE FUNCTION add_one()",
340+
" LANGUAGE python",
341+
" AS '",
342+
" def add_one(x: int) -> int:",
343+
"",
344+
" return x + 1",
345+
" ';",
346+
"",
347+
" SELECT add_one(1);",
348+
];
349+
let query = query_lines.join("\n");
348350

349351
let ctx = SessionContext::new();
350352
let component = python_component().await;
@@ -379,16 +381,17 @@ async fn test_strip_indentation_empty_lines_not_indented() {
379381

380382
#[tokio::test(flavor = "multi_thread")]
381383
async fn test_strip_indentation_python_further_indented() {
382-
let query = r#"
383-
CREATE FUNCTION add_one()
384-
LANGUAGE python
385-
AS '
386-
def add_one(x: int) -> int:
387-
return x + 1
388-
';
389-
390-
SELECT add_one(1);
391-
"#;
384+
let query_lines = &[
385+
" CREATE FUNCTION add_one()",
386+
" LANGUAGE python",
387+
" AS '",
388+
" def add_one(x: int) -> int:",
389+
" return x + 1",
390+
" ';",
391+
" ",
392+
" SELECT add_one(1);",
393+
];
394+
let query = query_lines.join("\n");
392395

393396
let ctx = SessionContext::new();
394397
let component = python_component().await;

0 commit comments

Comments
 (0)