3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/nixos/tests/ripgrep.nix

14 lines
523 B
Nix
Raw Normal View History

2020-12-23 17:30:39 +00:00
import ./make-test-python.nix ({ pkgs, ... }: {
name = "ripgrep";
meta = with pkgs.lib.maintainers; { maintainers = [ nequissimus ]; };
2020-12-23 17:30:39 +00:00
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")
'';
})