summary refs log tree commit diff
path: root/nixos/tests/bat.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests/bat.nix')
-rw-r--r--nixos/tests/bat.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/tests/bat.nix b/nixos/tests/bat.nix
new file mode 100644
index 00000000000..0f548a590fb
--- /dev/null
+++ b/nixos/tests/bat.nix
@@ -0,0 +1,12 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+  name = "bat";
+  meta = with pkgs.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")
+  '';
+})