forked from mirrors/nixpkgs
ripgrep: Add test
This commit is contained in:
parent
d14182937d
commit
05bf935bc6
|
@ -324,6 +324,7 @@ in
|
|||
redis = handleTest ./redis.nix {};
|
||||
redmine = handleTest ./redmine.nix {};
|
||||
restic = handleTest ./restic.nix {};
|
||||
ripgrep = handleTest ./ripgrep.nix {};
|
||||
robustirc-bridge = handleTest ./robustirc-bridge.nix {};
|
||||
roundcube = handleTest ./roundcube.nix {};
|
||||
rspamd = handleTest ./rspamd.nix {};
|
||||
|
|
13
nixos/tests/ripgrep.nix
Normal file
13
nixos/tests/ripgrep.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "ripgrep";
|
||||
meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ nequissimus ]; };
|
||||
|
||||
nodes.ripgrep = { pkgs, ... }: { environment.systemPackages = [ pkgs.ripgrep ]; };
|
||||
|
||||
testScript = ''
|
||||
ripgrep.succeed('echo "abc\nbcd\ncde" > /tmp/foo')
|
||||
assert "bcd" in ripgrep.succeed("rg -N 'bcd' /tmp/foo")
|
||||
assert "bcd\ncde" in ripgrep.succeed("rg -N 'cd' /tmp/foo")
|
||||
assert "ripgrep ${pkgs.ripgrep.version}" in ripgrep.succeed("rg --version | head -1")
|
||||
'';
|
||||
})
|
|
@ -1,4 +1,5 @@
|
|||
{ stdenv
|
||||
, nixosTests
|
||||
, fetchFromGitHub
|
||||
, rustPlatform
|
||||
, asciidoctor
|
||||
|
@ -34,6 +35,8 @@ rustPlatform.buildRustPackage rec {
|
|||
installShellCompletion --zsh complete/_rg
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests) ripgrep; };
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A utility that combines the usability of The Silver Searcher with the raw speed of grep";
|
||||
homepage = "https://github.com/BurntSushi/ripgrep";
|
||||
|
|
Loading…
Reference in a new issue