forked from mirrors/nixpkgs
bat: Add test
This commit is contained in:
parent
2d85247086
commit
fe8fa45573
|
@ -30,6 +30,7 @@ in
|
|||
avahi-with-resolved = handleTest ./avahi.nix { networkd = true; };
|
||||
awscli = handleTest ./awscli.nix { };
|
||||
babeld = handleTest ./babeld.nix {};
|
||||
bat = handleTest ./bat.nix {};
|
||||
bazarr = handleTest ./bazarr.nix {};
|
||||
bcachefs = handleTestOn ["x86_64-linux"] ./bcachefs.nix {}; # linux-4.18.2018.10.12 is unsupported on aarch64
|
||||
beanstalkd = handleTest ./beanstalkd.nix {};
|
||||
|
|
12
nixos/tests/bat.nix
Normal file
12
nixos/tests/bat.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "bat";
|
||||
meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ nequissimus ]; };
|
||||
|
||||
machine = { pkgs, ... }: { environment.systemPackages = [ pkgs.bat ]; };
|
||||
|
||||
testScript = ''
|
||||
machine.succeed("echo 'Foobar\n\n\n42' > /tmp/foo")
|
||||
assert "Foobar" in machine.succeed("bat -p /tmp/foo")
|
||||
assert "42" in machine.succeed("bat -p /tmp/foo -r 4:4")
|
||||
'';
|
||||
})
|
|
@ -1,4 +1,5 @@
|
|||
{ stdenv
|
||||
, nixosTests
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
|
@ -38,6 +39,8 @@ rustPlatform.buildRustPackage rec {
|
|||
--prefix PATH : "${stdenv.lib.makeBinPath [ less ]}"
|
||||
'';
|
||||
|
||||
passthru.tests = { inherit (nixosTests) bat; };
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A cat(1) clone with syntax highlighting and Git integration";
|
||||
homepage = "https://github.com/sharkdp/bat";
|
||||
|
|
Loading…
Reference in a new issue