mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
tests/grep: add tests
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
13
tests/modules/programs/grep/basic-configuration.nix
Normal file
13
tests/modules/programs/grep/basic-configuration.nix
Normal 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'
|
||||
'';
|
||||
};
|
||||
}
|
||||
4
tests/modules/programs/grep/default.nix
Normal file
4
tests/modules/programs/grep/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
grep-basic-configuration = ./basic-configuration.nix;
|
||||
grep-with-colors = ./with-colors.nix;
|
||||
}
|
||||
17
tests/modules/programs/grep/with-colors.nix
Normal file
17
tests/modules/programs/grep/with-colors.nix
Normal 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"'
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user