Files
Anders Eknert 3368497a96 test: Start decomissioning test.WithTempFS (#8908)
The `test.WithTempFS` helper is used _extensively_ throughout our tests.
Since `t.TempDir()` became a thing (Go 1.16), it probably shouldn't be,
as that function does all the same things but in a more idiomatic
manner.

Main issues with `test.WithTempFS`:

- It doesn't take a `*testing.T`, making failures reported without
correct/helpful location.
- It creates a new scope for no particular reason, where it could just
have returned the root directory instead. An additional scope == an
additionl level of indentation.

This change adds the new `test.TempDir` and `test.TempDirOf` functions,
which tries to address these issues. There are way too many places where
`test.WithTempFS` is used for me to fix in a single PR, so more will
have to come later. Most of the changes here don't even use the new
functions, but replace the use of `test.WithTempFS` with `t.TempDir()`
directly, as no files were passed to the function there.

Also:
- Replace a number of `reflect.DeepEqual` calls with better alternatives
(not using reflection)

Recommended reviewing with whitespace diffs hidden!

Signed-off-by: Anders Eknert <anders.eknert@apple.com>
2026-07-20 20:48:24 +02:00
..
2025-05-20 23:12:13 +02:00
2024-12-12 15:09:03 +01:00