Files
opentf/internal/command/e2etest/provider_plugin_test.go
Martin Atkins ddd67d4c72 e2etest: TestProviderGlobalCache generate valid CLI config on Windows
This test uses a temporary file as an overridden CLI configuration to
force using a specific plugin cache directory, but temporary file paths
contain backslashes on Windows and the CLI configuration syntax is HCL
so would require backslashes to be escaped.

Since Windows will accept forward-slash paths as a supported variation,
and we typically recommend that folks write paths that way in HCL for
portability anyway, this uses filepath.ToSlash to force consistent use
of slashes on all platforms. It would also have been reasonable to use
a %q format verb to use Go's string quoting syntax, but that's not the
way we typically recommend folks hand-write their CLI configurations and
so this way is just-so-slightly more "realistic".

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-05 10:36:17 -07:00

4.3 KiB