3
0
Fork 0
forked from mirrors/nixpkgs

ripgrep: Add test

This commit is contained in:
Tim Steinbach 2020-12-23 12:30:39 -05:00
parent d14182937d
commit 05bf935bc6
No known key found for this signature in database
GPG key ID: 1B40229F19262402
3 changed files with 17 additions and 0 deletions

View file

@ -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
View 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")
'';
})

View file

@ -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";