Skip to content

Commit

Permalink
vivid: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoruto committed Dec 28, 2024
1 parent d96fc0f commit f930582
Show file tree
Hide file tree
Showing 8 changed files with 1,422 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ in import nmtSrc {
./modules/programs/translate-shell
./modules/programs/vifm
./modules/programs/vim-vint
./modules/programs/vivid
./modules/programs/vscode
./modules/programs/watson
./modules/programs/wezterm
Expand Down
6 changes: 6 additions & 0 deletions tests/modules/programs/vivid/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
vivid-empty-settings = ./empty.nix;
vivid-enable-shells = ./enable-shells.nix;
vivid-filetypes = ./filetypes-example.nix;
vivid-themes = ./themes-example.nix;
}
11 changes: 11 additions & 0 deletions tests/modules/programs/vivid/empty.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
programs.vivid = {
enable = true;
theme = "test";
};
test.stubs.vivid = { };
nmt.script = ''
assertPathNotExists home-files/.config/vivid/filetypes.yaml
assertPathNotExists home-files/.config/vivid/themes
'';
}
46 changes: 46 additions & 0 deletions tests/modules/programs/vivid/enable-shells.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{ lib, ... }:

{
programs = {
vivid = {
enable = true;
theme = "test";
enableBashIntegration = true;
enableFishIntegration = true;
enableNushellIntegration = true;
enableZshIntegration = true;
};
bash.enable = true;
fish.enable = true;
nushell.enable = true;
zsh.enable = true;
};

# Needed to avoid error with dummy fish package.
xdg.dataFile."fish/home-manager_generated_completions".source =
lib.mkForce (builtins.toFile "empty" "");

test.stubs.vivid = { };

nmt.script = ''
assertFileExists home-files/.bashrc
assertFileContains \
home-files/.bashrc \
'export LS_COLORS="$(@vivid@/bin/dummy generate test)"'
assertFileExists home-files/.config/fish/config.fish
assertFileContains \
home-files/.config/fish/config.fish \
'set -gx LS_COLORS (@vivid@/bin/dummy generate test)'
assertFileExists home-files/.config/nushell/env.nu
assertFileContains \
home-files/.config/nushell/env.nu \
'"LS_COLORS": (@vivid@/bin/dummy generate test)'
assertFileExists home-files/.zshrc
assertFileContains \
home-files/.zshrc \
'export LS_COLORS="$(@vivid@/bin/dummy generate test)"'
'';
}
Loading

0 comments on commit f930582

Please sign in to comment.