Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions prqlc/prqlc/tests/integration/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ mod fmt {
assert_snapshot!(test_name, &formatted, &prql)
});

// Check the formatted queries can still compile
prqlc::prql_to_pl(&formatted).unwrap();
// Formatting is idempotent: re-parsing & re-formatting the output must
// reproduce it exactly. This also covers the weaker property that the
// formatted query still parses.
let reformatted = prqlc::pl_to_prql(&prqlc::prql_to_pl(&formatted).unwrap()).unwrap();
similar_asserts::assert_eq!(formatted, reformatted);
}
}

Expand Down
Loading