ellip_dev_utils/file.rs
1/*
2 * Ellip is licensed under The 3-Clause BSD, see LICENSE.
3 * Copyright 2025 Sira Pornsiriprasert <code@psira.me>
4 */
5
6use std::path::PathBuf;
7
8/// Finds test data files matching the pattern: function_name_*.csv
9pub fn find_test_files(function_name: &str, dir: &str) -> Vec<PathBuf> {
10 // Also try the wolfram directory specifically as fallback
11 let pattern = format!("tests/data/{dir}/{function_name}_*.csv");
12 glob::glob(&pattern)
13 .unwrap()
14 .map(|path| path.unwrap())
15 .collect()
16}