nixpkgs-suyu/nixos/tests/ripgrep.nix

14 lines
523 B
Nix
Raw Normal View History

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