chore: Clarify error on missing test suite

Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
This commit is contained in:
Dmitry Dygalo 2024-03-03 21:26:10 +01:00
parent 8eacf2d9da
commit 9771bc227c
No known key found for this signature in database
GPG Key ID: 26834366E8FDCFEF
1 changed files with 9 additions and 3 deletions

View File

@ -39,9 +39,15 @@ fn draft_version(json_schema_test_suite_path: &Path, file_path: &Path) -> String
fn load_inner(json_schema_test_suite_path: &Path, dir: &Path, prefix: &str) -> Vec<TestCase> {
let mut tests = vec![];
for result_entry in
fs::read_dir(dir).unwrap_or_else(|_| panic!("Tests directory not found: {}", dir.display()))
{
for result_entry in fs::read_dir(dir).unwrap_or_else(|_| {
panic!(
r#"JSON Schema Test Suite not found.
Please ensure the test suite has been initialized correctly.
Run `git submodule init` and `git submodule update` in the root directory to initialize it.
If the issue persists, please verify the path to `{}` is correct."#,
dir.display()
)
}) {
if let Ok(entry) = result_entry {
let path = entry.path();
if entry.file_type().map(|ft| ft.is_dir()).unwrap_or(false) {