From 27a6182347ccae90a88231ae0dc5dfa7d15815bb Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 5 Dec 2025 23:05:47 -0600 Subject: [PATCH] tests/diff-highlight: add null assertion test Verify eval when setting git package to null. Signed-off-by: Austin Horstman --- .../programs/diff-highlight/default.nix | 1 + ...ff-highlight-git-package-null-assertion.nix | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/modules/programs/diff-highlight/diff-highlight-git-package-null-assertion.nix diff --git a/tests/modules/programs/diff-highlight/default.nix b/tests/modules/programs/diff-highlight/default.nix index 5bdbe52dd..8764b8c56 100644 --- a/tests/modules/programs/diff-highlight/default.nix +++ b/tests/modules/programs/diff-highlight/default.nix @@ -2,4 +2,5 @@ diff-highlight-basic = ./diff-highlight-basic.nix; diff-highlight-with-git-integration = ./diff-highlight-with-git-integration.nix; diff-highlight-migration = ./diff-highlight-migration.nix; + diff-highlight-git-package-null-assertion = ./diff-highlight-git-package-null-assertion.nix; } diff --git a/tests/modules/programs/diff-highlight/diff-highlight-git-package-null-assertion.nix b/tests/modules/programs/diff-highlight/diff-highlight-git-package-null-assertion.nix new file mode 100644 index 000000000..52e795bc6 --- /dev/null +++ b/tests/modules/programs/diff-highlight/diff-highlight-git-package-null-assertion.nix @@ -0,0 +1,18 @@ +{ + programs.diff-highlight = { + enable = true; + enableGitIntegration = true; + }; + + programs.git = { + enable = true; + package = null; + }; + + test.asserts.assertions.expected = [ + '' + programs.diff-highlight.enableGitIntegration requires programs.git.package to be set. + Please set programs.git.package to a valid git package. + '' + ]; +}