Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Thrasher <[email protected]>
  • Loading branch information
2 people authored and peterhuene committed Jan 14, 2025
1 parent 3054563 commit 3c79015
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wdl-format/tests/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ fn prepare_document(source: &str, path: &Path) -> Result<FormatElement, String>
}

/// Parses and formats source string
fn do_format(source: &str, path: &Path) -> Result<String, String> {
fn format(source: &str, path: &Path) -> Result<String, String> {
let document = prepare_document(&source, &path)?;
let formatted = match Formatter::default().format(&document) {
Ok(formatted) => formatted,
Expand All @@ -160,11 +160,11 @@ fn run_test(test: &Path, ntests: &AtomicUsize) -> Result<(), String> {
)
})?;

let formatted = do_format(&source, path.as_path())?;
let formatted = format(&source, path.as_path())?;
compare_result(formatted_path.as_path(), &formatted)?;

// test idepotency by formatting the formatted document
let twice_formatted = do_format(&formatted, formatted_path.as_path())?;
// test idempotency by formatting the formatted document
let twice_formatted = format(&formatted, formatted_path.as_path())?;
compare_result(formatted_path.as_path(), &twice_formatted)?;

ntests.fetch_add(1, Ordering::SeqCst);
Expand Down

0 comments on commit 3c79015

Please sign in to comment.