tests/grep: add tests

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2025-10-05 14:33:38 -05:00
parent c2e3f1cacd
commit 994d854a4a
3 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
{
config = {
programs.grep = {
enable = true;
};
nmt.script = ''
# Verify no GREP_COLORS environment variable is set when colors is empty
hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
assertFileNotRegex $hmEnvFile 'GCC_COLORS'
'';
};
}

View File

@@ -0,0 +1,4 @@
{
grep-basic-configuration = ./basic-configuration.nix;
grep-with-colors = ./with-colors.nix;
}

View File

@@ -0,0 +1,17 @@
{
config = {
programs.grep = {
enable = true;
colors = {
error = "01;31";
match = "01;32";
};
};
nmt.script = ''
# Check that grep colors are set in session variables
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
'export GREP_COLORS="error=01;31:match=01;32"'
'';
};
}