ripgrep: Add test

wip/yesman
Tim Steinbach 4 years ago
parent d14182937d
commit 05bf935bc6
No known key found for this signature in database
GPG Key ID: 1B40229F19262402
  1. 1
      nixos/tests/all-tests.nix
  2. 13
      nixos/tests/ripgrep.nix
  3. 3
      pkgs/tools/text/ripgrep/default.nix

@ -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 {};

@ -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…
Cancel
Save