diff --git a/bench_runner/result.py b/bench_runner/result.py index f561126..240c5cb 100644 --- a/bench_runner/result.py +++ b/bench_runner/result.py @@ -48,9 +48,9 @@ def _clean(string: str) -> str: """ Clean an arbitrary string to be suitable for a filename. - It can't contain dashes, since dashes are used as a delimiter. + Dashes delimit filename fields, and slashes would create subdirectories. """ - return string.replace("-", "_") + return string.replace("-", "_").replace("/", "_") def _clean_for_url(string: str) -> str: diff --git a/tests/test_result.py b/tests/test_result.py index d878b79..ecdcd12 100644 --- a/tests/test_result.py +++ b/tests/test_result.py @@ -122,3 +122,7 @@ def gethostname(*args): f"bm-20221119-{platform.system().lower()}-{platform.machine().lower()}" f"-my%2dfork-9d38120e335357a3b294-{platform.python_version()}-b7e4f1d.json" ) + + result = mod_result.Result.from_scratch(python, "my-fork", "jit/free-threading") + assert result.ref == "jit_free_threading" + assert result.filename.parent.parent == Path("results")