haskellPackages.changelog-d: Add basic test
This commit is contained in:
parent
054f67065e
commit
662c001157
1 changed files with 26 additions and 1 deletions
|
@ -3,7 +3,7 @@
|
|||
, pkgs
|
||||
}:
|
||||
|
||||
(callPackage ./changelog-d.nix { }).overrideAttrs (oldAttrs: {
|
||||
(callPackage ./changelog-d.nix { }).overrideAttrs (finalAttrs: oldAttrs: {
|
||||
|
||||
version = oldAttrs.version + "-git-${lib.strings.substring 0 7 oldAttrs.src.rev}";
|
||||
|
||||
|
@ -17,6 +17,31 @@
|
|||
cabal2nix https://codeberg.org/fgaz/changelog-d >changelog-d.nix
|
||||
'';
|
||||
});
|
||||
passthru.tests = {
|
||||
basic = pkgs.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
|
||||
'';
|
||||
};
|
||||
|
||||
meta = oldAttrs.meta // {
|
||||
homepage = "https://codeberg.org/fgaz/changelog-d";
|
||||
|
|
Loading…
Reference in a new issue