1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-26 16:38:34 +02: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:
Robert Helgesson 2021-11-07 09:42:31 +01:00
parent c678162e20
commit 2917ef23b3
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
6 changed files with 61 additions and 51 deletions

View File

@ -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;

View File

@ -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
'';
}

View 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
'';
};
}

View File

@ -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
'';
}

View File

@ -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 '\"'"
'';
}

View File

@ -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'"
'';
}