From 8929c5f3bcb30d5b78d472fa12450b7dbb8a7ac2 Mon Sep 17 00:00:00 2001 From: SunOfLife1 Date: Wed, 5 Nov 2025 13:22:53 -0500 Subject: [PATCH] test/lazygit: add fish integration test This does also add a test module for lazygit since there wasn't one already --- tests/modules/programs/lazygit/default.nix | 3 +++ .../lazygit/fish-integration-enabled.nix | 18 ++++++++++++++++++ .../lazygit/fish-integration-expected.fish | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 tests/modules/programs/lazygit/default.nix create mode 100644 tests/modules/programs/lazygit/fish-integration-enabled.nix create mode 100644 tests/modules/programs/lazygit/fish-integration-expected.fish diff --git a/tests/modules/programs/lazygit/default.nix b/tests/modules/programs/lazygit/default.nix new file mode 100644 index 00000000..106c564a --- /dev/null +++ b/tests/modules/programs/lazygit/default.nix @@ -0,0 +1,3 @@ +{ + lazygit-fish-integration-enabled = ./fish-integration-enabled.nix; +} diff --git a/tests/modules/programs/lazygit/fish-integration-enabled.nix b/tests/modules/programs/lazygit/fish-integration-enabled.nix new file mode 100644 index 00000000..f7183ca4 --- /dev/null +++ b/tests/modules/programs/lazygit/fish-integration-enabled.nix @@ -0,0 +1,18 @@ +{ config, ... }: + +{ + programs.fish.enable = true; + + home.preferXdgDirectories = false; + + programs.lazygit = { + enable = true; + shellWrapperName = "lg"; + enableFishIntegration = true; + }; + + nmt.script = '' + assertFileContent home-files/.config/fish/functions/${config.programs.lazygit.shellWrapperName}.fish \ + ${./fish-integration-expected.fish} + ''; +} diff --git a/tests/modules/programs/lazygit/fish-integration-expected.fish b/tests/modules/programs/lazygit/fish-integration-expected.fish new file mode 100644 index 00000000..84d64a2f --- /dev/null +++ b/tests/modules/programs/lazygit/fish-integration-expected.fish @@ -0,0 +1,8 @@ +function lg + set -x LAZYGIT_NEW_DIR_FILE ~/.lazygit/newdir + command lazygit $argv + if test -f $LAZYGIT_NEW_DIR_FILE + cd (cat $LAZYGIT_NEW_DIR_FILE) + rm -f $LAZYGIT_NEW_DIR_FILE + end +end