rename expect_format_helper and add comment

This commit is contained in:
Joshua Warner 2021-12-03 19:32:44 -08:00
parent 5d3d4467c1
commit 4bbe1d308a

View file

@ -14,7 +14,8 @@ mod test_fmt {
use roc_parse::parser::{Parser, State}; use roc_parse::parser::{Parser, State};
use roc_test_utils::assert_multiline_str_eq; use roc_test_utils::assert_multiline_str_eq;
fn _expect_format_helper(input: &str, expected: &str) { // Not intended to be used directly in tests; please use expr_formats_to or expr_formats_same
fn expect_format_helper(input: &str, expected: &str) {
let arena = Bump::new(); let arena = Bump::new();
match roc_parse::test_helpers::parse_expr_with(&arena, input.trim()) { match roc_parse::test_helpers::parse_expr_with(&arena, input.trim()) {
Ok(actual) => { Ok(actual) => {
@ -33,11 +34,11 @@ mod test_fmt {
let expected = expected.trim_end(); let expected = expected.trim_end();
// First check that input formats to the expected version // First check that input formats to the expected version
_expect_format_helper(input, expected); expect_format_helper(input, expected);
// Parse the expected result format it, asserting that it doesn't change // Parse the expected result format it, asserting that it doesn't change
// It's important that formatting be stable / idempotent // It's important that formatting be stable / idempotent
_expect_format_helper(expected, expected); expect_format_helper(expected, expected);
} }
fn expr_formats_same(input: &str) { fn expr_formats_same(input: &str) {