From 6616d7deeb3541f8190582ae8f942db440f27db2 Mon Sep 17 00:00:00 2001 From: Andrew Hlynskyi Date: Thu, 17 Aug 2023 23:28:48 +0300 Subject: [PATCH] Change edit dumps format and add indexes for all corpus tests The new dumped edits format is `edit....` To cleanup edits: - Instead of the standard: > rm target/scratch/edit.* - Use the following shell command: > find target/scratch/ -name 'edit.*' -delete --- cli/src/tests/corpus_test.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cli/src/tests/corpus_test.rs b/cli/src/tests/corpus_test.rs index 9e4729d3..6b2f2a20 100644 --- a/cli/src/tests/corpus_test.rs +++ b/cli/src/tests/corpus_test.rs @@ -111,8 +111,10 @@ fn test_language_corpus(start_seed: usize, language_name: &str) { } println!(); - for test in tests { - println!(" {} example - {}", language_name, test.name); + for (test_index, test) in tests.iter().enumerate() { + let test_name = format!("{language_name} example - {}", test.name); + + println!(" {test_index}. {test_name}"); let passed = allocations::record(|| { let mut log_session = None; @@ -173,11 +175,16 @@ fn test_language_corpus(start_seed: usize, language_name: &str) { } if log_seed { - println!(" seed: {}", seed); + println!(" {test_index}.{trial:<2} seed: {}", seed); } if dump_edits { - fs::write(SCRATCH_BASE_DIR.join(format!("{seed}.edit")), &input).unwrap(); + fs::write( + SCRATCH_BASE_DIR + .join(format!("edit.{seed}.{test_index}.{trial} {test_name}")), + &input, + ) + .unwrap(); } if *LOG_GRAPH_ENABLED {