1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 20:21:14 +00:00
nixpkgs/nixos/tests/ripgrep.nix
2020-12-23 12:30:39 -05:00

14 lines
530 B
Nix

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