mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
sgrep: add smoke test
This commit is contained in:
parent
8d9ea37e80
commit
37681056c2
1 changed files with 9 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, fetchurl, lib, m4, makeWrapper }:
|
||||
{ stdenv, sgrep, fetchurl, runCommand, lib, m4, makeWrapper }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sgrep";
|
||||
|
@ -16,6 +16,14 @@ stdenv.mkDerivation rec {
|
|||
--prefix PATH : ${lib.makeBinPath [ m4 ]}
|
||||
'';
|
||||
|
||||
passthru.tests.smokeTest = runCommand "test-sgrep" { } ''
|
||||
expr='"<foo>" __ "</foo>"'
|
||||
data="<foo>1</foo><bar>2</bar>"
|
||||
${sgrep}/bin/sgrep "$expr" <<<$data >$out
|
||||
read result <$out
|
||||
[[ $result = 1 ]]
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.cs.helsinki.fi/u/jjaakkol/sgrep.html";
|
||||
description = "A grep for structured text formats such as XML";
|
||||
|
|
Loading…
Reference in a new issue