git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #117005 from tomberek/go-yq/test

yq-go: add simple test

commit0b938eae3b486a5fe12cce8210db60f694098afc authorMaximilian Bosch <maximilian@mbosch.me> dateFri 9 Apr 2021, 18:01 (6 years ago) parent79d2bf447c48e0
1 file changed+8−1
pkgs/development/tools/yq-go/default.nix+8−1
pkgs/development/tools/yq-go/default.nix+8−1
@@ -1,4 +1,4 @@
1−{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
1+{ lib, buildGoModule, fetchFromGitHub, installShellFiles, runCommand, yq-go }:
22
33buildGoModule rec {
44 pname = "yq-go";
@@ -24,6 +24,13 @@ buildGoModule rec {
2424 done
2525 '';
2626
27+ passthru.tests = {
28+ simple = runCommand "${pname}-test" {} ''
29+ echo "test: 1" | ${yq-go}/bin/yq eval -j > $out
30+ [ "$(cat $out | tr -d $'\n ')" = '{"test":1}' ]
31+ '';
32+ };
33+
2734 meta = with lib; {
2835 description = "Portable command-line YAML processor";
2936 homepage = "https://mikefarah.gitbook.io/yq/";