mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
kakoune: clean up tests
- Enable use-plugins test. - Stub out `kakoune-unwrapped` to avoid unnecessary downloads. - Unwrap unnecessary `config` attributes.
This commit is contained in:
parent
c678162e20
commit
2917ef23b3
6 changed files with 61 additions and 51 deletions
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
kakoune-no-plugins = ./no-plugins.nix;
|
||||
# Temporarily disabled until https://github.com/NixOS/nixpkgs/pull/110196
|
||||
# reaches the unstable channel.
|
||||
# kakoune-use-plugins = ./use-plugins.nix;
|
||||
kakoune-use-plugins = ./use-plugins.nix;
|
||||
kakoune-whitespace-highlighter = ./whitespace-highlighter.nix;
|
||||
kakoune-whitespace-highlighter-corner-cases =
|
||||
./whitespace-highlighter-corner-cases.nix;
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.kakoune = { enable = true; };
|
||||
imports = [ ./stubs.nix ];
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-path/share/kak/autoload/plugins
|
||||
'';
|
||||
};
|
||||
programs.kakoune = { enable = true; };
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-path/share/kak/autoload/plugins
|
||||
'';
|
||||
}
|
||||
|
|
12
tests/modules/programs/kakoune/stubs.nix
Normal file
12
tests/modules/programs/kakoune/stubs.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
test.stubs.kakoune-unwrapped = {
|
||||
name = "dummy-kakoune";
|
||||
version = "1";
|
||||
outPath = null;
|
||||
buildScript = ''
|
||||
mkdir -p $out/bin $out/share/kak/doc
|
||||
touch $out/bin/kak
|
||||
chmod +x $out/bin/kak
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -3,14 +3,14 @@
|
|||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.kakoune = {
|
||||
enable = true;
|
||||
plugins = [ pkgs.kakounePlugins.kak-prelude ];
|
||||
};
|
||||
imports = [ ./stubs.nix ];
|
||||
|
||||
nmt.script = ''
|
||||
assertDirectoryNotEmpty home-path/share/kak/autoload/plugins
|
||||
'';
|
||||
programs.kakoune = {
|
||||
enable = true;
|
||||
plugins = [ pkgs.kakounePlugins.prelude-kak ];
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertDirectoryNotEmpty home-path/share/kak/autoload/plugins
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -3,23 +3,23 @@
|
|||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.kakoune = {
|
||||
enable = true;
|
||||
config.showWhitespace = {
|
||||
enable = true;
|
||||
lineFeed = ''"'';
|
||||
space = " ";
|
||||
nonBreakingSpace = "' '"; # backwards compat
|
||||
tab = "'";
|
||||
# tabStop = <default>
|
||||
};
|
||||
};
|
||||
imports = [ ./stubs.nix ];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/kak/kakrc
|
||||
assertFileContains home-files/.config/kak/kakrc \
|
||||
"add-highlighter global/ show-whitespaces -tab \"'\" -spc ' ' -nbsp ' ' -lf '\"'"
|
||||
'';
|
||||
programs.kakoune = {
|
||||
enable = true;
|
||||
config.showWhitespace = {
|
||||
enable = true;
|
||||
lineFeed = ''"'';
|
||||
space = " ";
|
||||
nonBreakingSpace = "' '"; # backwards compat
|
||||
tab = "'";
|
||||
# tabStop = <default>
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/kak/kakrc
|
||||
assertFileContains home-files/.config/kak/kakrc \
|
||||
"add-highlighter global/ show-whitespaces -tab \"'\" -spc ' ' -nbsp ' ' -lf '\"'"
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -3,23 +3,23 @@
|
|||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.kakoune = {
|
||||
enable = true;
|
||||
config.showWhitespace = {
|
||||
enable = true;
|
||||
lineFeed = "1";
|
||||
space = "2";
|
||||
nonBreakingSpace = "3";
|
||||
tab = "4";
|
||||
tabStop = "5";
|
||||
};
|
||||
};
|
||||
imports = [ ./stubs.nix ];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/kak/kakrc
|
||||
assertFileContains home-files/.config/kak/kakrc \
|
||||
"add-highlighter global/ show-whitespaces -tab '4' -tabpad '5' -spc '2' -nbsp '3' -lf '1'"
|
||||
'';
|
||||
programs.kakoune = {
|
||||
enable = true;
|
||||
config.showWhitespace = {
|
||||
enable = true;
|
||||
lineFeed = "1";
|
||||
space = "2";
|
||||
nonBreakingSpace = "3";
|
||||
tab = "4";
|
||||
tabStop = "5";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/kak/kakrc
|
||||
assertFileContains home-files/.config/kak/kakrc \
|
||||
"add-highlighter global/ show-whitespaces -tab '4' -tabpad '5' -spc '2' -nbsp '3' -lf '1'"
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue