Skip to content

Commit 973575f

Browse files
authored
chore: refresh insta snapshots to latest format (#5943)
1 parent 8c8c921 commit 973575f

16 files changed

Lines changed: 110 additions & 111 deletions

File tree

prqlc/bindings/prqlc-python/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ mod test {
183183

184184
assert_snapshot!(
185185
compile("from employees | filter (age | in 20..30)", opts).unwrap(),
186-
@r"
186+
@"
187187
SELECT
188188
*
189189
FROM
@@ -206,7 +206,7 @@ mod test {
206206

207207
let prql = r#"from artists | select {name, id} | filter (id | in [1, 2, 3])"#;
208208
assert_snapshot!(
209-
prql_to_pl(prql).and_then(|x| pl_to_rq(x.as_str())).and_then(|x|rq_to_sql(x.as_str(), opts)).unwrap(), @r"
209+
prql_to_pl(prql).and_then(|x| pl_to_rq(x.as_str())).and_then(|x|rq_to_sql(x.as_str(), opts)).unwrap(), @"
210210
SELECT
211211
name,
212212
id
@@ -221,7 +221,7 @@ mod test {
221221
fn prql_pl_prql_roundtrip() {
222222
let prql = r#"from artists | select {name, id} | filter (id | in [1, 2, 3])"#;
223223
assert_snapshot!(
224-
prql_to_pl(prql).and_then(|x| pl_to_prql(x.as_str())).unwrap(), @r"
224+
prql_to_pl(prql).and_then(|x| pl_to_prql(x.as_str())).unwrap(), @"
225225
from artists
226226
select {name, id}
227227
filter (id | in [1, 2, 3])

prqlc/prqlc-parser/src/lexer/test.rs

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn line_wrap() {
2626

2727
// Basic line wrap test
2828
assert_debug_snapshot!(test_line_wrap_tokens(r"5 +
29-
\ 3 "), @r"
29+
\ 3 "), @"
3030
Tokens(
3131
[
3232
0..1: Literal(Integer(5)),
@@ -77,7 +77,7 @@ fn debug_display() {
7777
Tokens(lexer().parse(input).output().unwrap().to_vec())
7878
}
7979

80-
assert_debug_snapshot!(test_tokens("5 + 3"), @r"
80+
assert_debug_snapshot!(test_tokens("5 + 3"), @"
8181
Tokens(
8282
[
8383
0..1: Literal(Integer(5)),
@@ -221,7 +221,7 @@ fn range() {
221221
Tokens(lexer().parse(input).output().unwrap().to_vec())
222222
}
223223

224-
assert_debug_snapshot!(test_range_tokens("1..2"), @r"
224+
assert_debug_snapshot!(test_range_tokens("1..2"), @"
225225
Tokens(
226226
[
227227
0..1: Literal(Integer(1)),
@@ -231,7 +231,7 @@ fn range() {
231231
)
232232
");
233233

234-
assert_debug_snapshot!(test_range_tokens("..2"), @r"
234+
assert_debug_snapshot!(test_range_tokens("..2"), @"
235235
Tokens(
236236
[
237237
0..2: Range { bind_left: true, bind_right: true },
@@ -240,7 +240,7 @@ fn range() {
240240
)
241241
");
242242

243-
assert_debug_snapshot!(test_range_tokens("1.."), @r"
243+
assert_debug_snapshot!(test_range_tokens("1.."), @"
244244
Tokens(
245245
[
246246
0..1: Literal(Integer(1)),
@@ -267,7 +267,7 @@ fn range() {
267267
fn test_lex_source() {
268268
use insta::assert_debug_snapshot;
269269

270-
assert_debug_snapshot!(lex_source("5 + 3"), @r"
270+
assert_debug_snapshot!(lex_source("5 + 3"), @"
271271
Ok(
272272
Tokens(
273273
[
@@ -291,20 +291,20 @@ fn test_annotation_tokens() {
291291
// Test basic annotation token
292292
let result = super::lex_source("@{binding_strength=1}");
293293
assert_debug_snapshot!(result, @r#"
294-
Ok(
295-
Tokens(
296-
[
297-
0..0: Start,
298-
0..1: Annotate,
299-
1..2: Control('{'),
300-
2..18: Ident("binding_strength"),
301-
18..19: Control('='),
302-
19..20: Literal(Integer(1)),
303-
20..21: Control('}'),
304-
],
305-
),
306-
)
307-
"#);
294+
Ok(
295+
Tokens(
296+
[
297+
0..0: Start,
298+
0..1: Annotate,
299+
1..2: Control('{'),
300+
2..18: Ident("binding_strength"),
301+
18..19: Control('='),
302+
19..20: Literal(Integer(1)),
303+
20..21: Control('}'),
304+
],
305+
),
306+
)
307+
"#);
308308

309309
// Test multi-line annotation
310310
let result = super::lex_source(
@@ -314,32 +314,32 @@ fn test_annotation_tokens() {
314314
"#,
315315
);
316316
assert_debug_snapshot!(result, @r#"
317-
Ok(
318-
Tokens(
319-
[
320-
0..0: Start,
321-
0..1: NewLine,
322-
9..10: Annotate,
323-
10..11: Control('{'),
324-
11..27: Ident("binding_strength"),
325-
27..28: Control('='),
326-
28..29: Literal(Integer(1)),
327-
29..30: Control('}'),
328-
30..31: NewLine,
329-
39..42: Keyword("let"),
330-
43..46: Ident("add"),
331-
47..48: Control('='),
332-
49..50: Ident("a"),
333-
51..52: Ident("b"),
334-
53..55: ArrowThin,
335-
56..57: Ident("a"),
336-
58..59: Control('+'),
337-
60..61: Ident("b"),
338-
61..62: NewLine,
339-
],
340-
),
341-
)
342-
"#);
317+
Ok(
318+
Tokens(
319+
[
320+
0..0: Start,
321+
0..1: NewLine,
322+
9..10: Annotate,
323+
10..11: Control('{'),
324+
11..27: Ident("binding_strength"),
325+
27..28: Control('='),
326+
28..29: Literal(Integer(1)),
327+
29..30: Control('}'),
328+
30..31: NewLine,
329+
39..42: Keyword("let"),
330+
43..46: Ident("add"),
331+
47..48: Control('='),
332+
49..50: Ident("a"),
333+
51..52: Ident("b"),
334+
53..55: ArrowThin,
335+
56..57: Ident("a"),
336+
58..59: Control('+'),
337+
60..61: Ident("b"),
338+
61..62: NewLine,
339+
],
340+
),
341+
)
342+
"#);
343343
}
344344

345345
#[test]

prqlc/prqlc/src/cli/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ sort full
708708
"",
709709
);
710710

711-
assert_snapshot!(&result.unwrap_err().to_string(), @r"
711+
assert_snapshot!(&result.unwrap_err().to_string(), @"
712712
Error:
713713
╭─[ :1:1 ]
714714
@@ -742,7 +742,7 @@ sort full
742742
"main",
743743
)
744744
.unwrap();
745-
assert_snapshot!(String::from_utf8(result).unwrap().trim(), @r"
745+
assert_snapshot!(String::from_utf8(result).unwrap().trim(), @"
746746
WITH x AS (
747747
SELECT
748748
y,
@@ -769,7 +769,7 @@ sort full
769769
)
770770
.unwrap();
771771

772-
assert_snapshot!(String::from_utf8(output).unwrap().trim(), @r"
772+
assert_snapshot!(String::from_utf8(output).unwrap().trim(), @"
773773
name: Project
774774
stmts:
775775
- VarDef:
@@ -816,7 +816,7 @@ sort full
816816

817817
// TODO: terser output; maybe serialize span as `0..4`? Remove the
818818
// `!Ident` complication?
819-
assert_snapshot!(String::from_utf8(output).unwrap().trim(), @r"
819+
assert_snapshot!(String::from_utf8(output).unwrap().trim(), @"
820820
- kind: Start
821821
span:
822822
start: 0
@@ -859,7 +859,7 @@ sort full
859859
)
860860
.unwrap();
861861

862-
assert_snapshot!(String::from_utf8(output).unwrap().trim(), @r"
862+
assert_snapshot!(String::from_utf8(output).unwrap().trim(), @"
863863
- kind: Start
864864
span:
865865
start: 0

prqlc/prqlc/src/cli/test.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use walkdir::WalkDir;
1313
#[cfg(not(windows))] // Windows has slightly different output (e.g. `prqlc.exe`), so we exclude.
1414
#[test]
1515
fn help() {
16-
assert_cmd_snapshot!(prqlc_command().arg("--help"), @r"
16+
assert_cmd_snapshot!(prqlc_command().arg("--help"), @"
1717
success: true
1818
exit_code: 0
1919
----- stdout -----
@@ -42,7 +42,7 @@ fn help() {
4242
");
4343

4444
// without arguments
45-
assert_cmd_snapshot!(prqlc_command(), @r"
45+
assert_cmd_snapshot!(prqlc_command(), @"
4646
success: true
4747
exit_code: 0
4848
----- stdout -----
@@ -73,7 +73,7 @@ fn help() {
7373

7474
#[test]
7575
fn get_targets() {
76-
assert_cmd_snapshot!(prqlc_command().arg("list-targets"), @r"
76+
assert_cmd_snapshot!(prqlc_command().arg("list-targets"), @"
7777
success: true
7878
exit_code: 0
7979
----- stdout -----
@@ -100,7 +100,7 @@ fn get_targets() {
100100
fn compile() {
101101
assert_cmd_snapshot!(prqlc_command()
102102
.args(["compile", "--hide-signature-comment"])
103-
.pass_stdin("from tracks"), @r"
103+
.pass_stdin("from tracks"), @"
104104
success: true
105105
exit_code: 0
106106
----- stdout -----
@@ -116,7 +116,7 @@ fn compile() {
116116
#[cfg(not(windows))] // Windows has slightly different output (e.g. `prqlc.exe`), so we exclude.
117117
#[test]
118118
fn compile_help() {
119-
assert_cmd_snapshot!(prqlc_command().args(["compile", "--help"]), @r"
119+
assert_cmd_snapshot!(prqlc_command().args(["compile", "--help"]), @"
120120
success: true
121121
exit_code: 0
122122
----- stdout -----
@@ -194,7 +194,7 @@ let long_query = (
194194
take 20
195195
)
196196
from long_query
197-
"#), @r"
197+
"#), @"
198198
success: true
199199
exit_code: 0
200200
----- stdout -----
@@ -278,7 +278,7 @@ fn compile_project() {
278278
"main",
279279
]);
280280

281-
assert_cmd_snapshot!(cmd, @r"
281+
assert_cmd_snapshot!(cmd, @"
282282
success: true
283283
exit_code: 0
284284
----- stdout -----
@@ -332,7 +332,7 @@ fn compile_project() {
332332
project_path().to_str().unwrap(),
333333
"-",
334334
"favorite_artists",
335-
]), @r"
335+
]), @"
336336
success: true
337337
exit_code: 0
338338
----- stdout -----
@@ -359,7 +359,7 @@ fn compile_project() {
359359
#[test]
360360
fn format() {
361361
// Test stdin formatting
362-
assert_cmd_snapshot!(prqlc_command().args(["fmt"]).pass_stdin("from tracks | take 20"), @r"
362+
assert_cmd_snapshot!(prqlc_command().args(["fmt"]).pass_stdin("from tracks | take 20"), @"
363363
success: true
364364
exit_code: 0
365365
----- stdout -----
@@ -604,7 +604,7 @@ fn normalize_prqlc(cmd: &mut Command) -> &mut Command {
604604

605605
#[test]
606606
fn compile_no_prql_files() {
607-
assert_cmd_snapshot!(prqlc_command().args(["compile", "README.md"]), @r"
607+
assert_cmd_snapshot!(prqlc_command().args(["compile", "README.md"]), @"
608608
success: false
609609
exit_code: 1
610610
----- stdout -----
@@ -616,7 +616,7 @@ fn compile_no_prql_files() {
616616

617617
#[test]
618618
fn lex() {
619-
assert_cmd_snapshot!(prqlc_command().args(["lex"]).pass_stdin("from tracks"), @r"
619+
assert_cmd_snapshot!(prqlc_command().args(["lex"]).pass_stdin("from tracks"), @"
620620
success: true
621621
exit_code: 0
622622
----- stdout -----

prqlc/prqlc/src/codegen/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ mod test {
556556
exprs: vec![short.clone(), long.clone(), long, short.clone()],
557557
}));
558558
// colons are a workaround to avoid trimming
559-
assert_snapshot!(pipeline.write(opt.clone()).unwrap(), @r"
559+
assert_snapshot!(pipeline.write(opt.clone()).unwrap(), @"
560560
(
561561
short
562562
some_really_long_and_really_long_name

prqlc/prqlc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ mod tests {
570570

571571
#[test]
572572
fn test_target_from_str() {
573-
assert_debug_snapshot!(Target::from_str("sql.postgres"), @r"
573+
assert_debug_snapshot!(Target::from_str("sql.postgres"), @"
574574
Ok(
575575
Sql(
576576
Some(

prqlc/prqlc/src/semantic/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub mod test {
191191
window range:-4..4 (
192192
derive {next_four_days = sum b}
193193
)
194-
"###).unwrap().relation.columns, @r"
194+
"###).unwrap().relation.columns, @"
195195
- Single: day
196196
- Single: b
197197
- Wildcard
@@ -205,7 +205,7 @@ pub mod test {
205205
from a=albums
206206
filter is_sponsored
207207
select {a.*}
208-
"###).unwrap().relation.columns, @r"
208+
"###).unwrap().relation.columns, @"
209209
- Single: is_sponsored
210210
- Wildcard
211211
")
@@ -216,7 +216,7 @@ pub mod test {
216216
assert_yaml_snapshot!(parse_resolve_and_lower(r###"
217217
from x
218218
select {a, a, a = a + 1}
219-
"###).unwrap().relation.columns, @r"
219+
"###).unwrap().relation.columns, @"
220220
- Single: ~
221221
- Single: ~
222222
- Single: a
@@ -229,7 +229,7 @@ pub mod test {
229229
prql target:sql.mssql version:"0"
230230
231231
from employees
232-
"#).unwrap(), @r"
232+
"#).unwrap(), @"
233233
def:
234234
version: ^0
235235
other:

prqlc/prqlc/src/semantic/resolver/transforms.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ mod tests {
11821182
group invoice_no (
11831183
take 1
11841184
)
1185-
").unwrap(), @r"
1185+
").unwrap(), @"
11861186
def:
11871187
version: ~
11881188
other: {}
@@ -1271,7 +1271,7 @@ mod tests {
12711271
sort (-issued_at)
12721272
sort {issued_at}
12731273
sort {-issued_at}
1274-
").unwrap(), @r"
1274+
").unwrap(), @"
12751275
def:
12761276
version: ~
12771277
other: {}

0 commit comments

Comments
 (0)