changelog-d: Move out tests.basic

This commit is contained in:
Robert Hensing 2023-11-19 12:24:10 +01:00
parent 9009c53c97
commit 3ce9db808b
2 changed files with 27 additions and 24 deletions

View File

@ -1,9 +1,9 @@
{
cabal2nix,
callPackage,
lib,
haskell,
haskellPackages,
runCommand,
writeShellApplication,
}:
@ -27,29 +27,7 @@ let
'';
});
passthru.tests = {
basic = runCommand "changelog-d-basic-test" {
nativeBuildInputs = [ finalAttrs.finalPackage ];
} ''
mkdir changelogs
cat > changelogs/config <<EOF
organization: NixOS
repository: boondoggle
EOF
cat > changelogs/a <<EOF
synopsis: Support numbers with incrementing base-10 digits
issues: #1234
description: {
This didn't work before.
}
EOF
changelog-d changelogs >$out
cat -n $out
echo Checking the generated output
set -x
grep -F 'Support numbers with incrementing base-10 digits' $out >/dev/null
grep -F 'https://github.com/NixOS/boondoggle/issues/1234' $out >/dev/null
set +x
'';
basic = callPackage ./tests/basic.nix { changelog-d = finalAttrs.finalPackage; };
};
meta = oldAttrs.meta // {

View File

@ -0,0 +1,25 @@
{ runCommand, changelog-d }:
runCommand "changelog-d-basic-test" {
nativeBuildInputs = [ changelog-d ];
} ''
mkdir changelogs
cat > changelogs/config <<EOF
organization: NixOS
repository: boondoggle
EOF
cat > changelogs/a <<EOF
synopsis: Support numbers with incrementing base-10 digits
issues: #1234
description: {
This didn't work before.
}
EOF
changelog-d changelogs >$out
cat -n $out
echo Checking the generated output
set -x
grep -F 'Support numbers with incrementing base-10 digits' $out >/dev/null
grep -F 'https://github.com/NixOS/boondoggle/issues/1234' $out >/dev/null
set +x
''