bats: use writeText instead of passAsFile

This fixes compatibility with __structuredAttrs.
This commit is contained in:
Stefan Frijters
2026-04-11 16:49:36 +02:00
parent bf35438a86
commit d3d6e2f38b
+3 -3
View File
@@ -18,6 +18,7 @@
symlinkJoin,
makeWrapper,
runCommand,
writeText,
doInstallCheck ? true,
# packages that use bats (for update testing)
bash-preexec,
@@ -157,7 +158,7 @@ resholve.mkDerivation rec {
libraries =
runCommand "${bats.name}-with-libraries-test"
{
testScript = ''
testScript = writeText "bats-libraries-test-script" ''
setup() {
bats_load_library bats-support
bats_load_library bats-assert
@@ -191,7 +192,6 @@ resholve.mkDerivation rec {
assert_output "hi"
}
'';
passAsFile = [ "testScript" ];
}
''
${
@@ -201,7 +201,7 @@ resholve.mkDerivation rec {
p.bats-file
p.bats-detik
])
}/bin/bats "$testScriptPath"
}/bin/bats "$testScript"
touch "$out"
'';