mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
Add OsSystem
support to mdtests (#16518)
## Summary This PR introduces a new mdtest option `system` that can either be `in-memory` or `os` where `in-memory` is the default. The motivation for supporting `os` is so that we can write OS/system specific tests with mdtests. Specifically, I want to write mdtests for the module resolver, testing that module resolution is case sensitive. ## Test Plan I tested that the case-sensitive module resolver test start failing when setting `system = "os"`
This commit is contained in:
parent
48f906e06c
commit
ce0018c3cb
31 changed files with 541 additions and 229 deletions
|
@ -106,7 +106,7 @@ fn setup_case() -> Case {
|
|||
let system = TestSystem::default();
|
||||
let fs = system.memory_file_system().clone();
|
||||
|
||||
fs.write_files(
|
||||
fs.write_files_all(
|
||||
TOMLLIB_FILES
|
||||
.iter()
|
||||
.map(|file| (tomllib_path(file), file.code().to_string())),
|
||||
|
@ -173,7 +173,7 @@ fn benchmark_incremental(criterion: &mut Criterion) {
|
|||
assert_diagnostics(&case.db, &result);
|
||||
|
||||
case.fs
|
||||
.write_file(
|
||||
.write_file_all(
|
||||
&case.re_path,
|
||||
format!("{}\n# A comment\n", source_text(&case.db, case.re).as_str()),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue