1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-28 04:39:48 +01:00

kakoune: simplify testcase

Instead of using several regex assertions, just state precisely what we
are producing. While the regex was technically more flexible, since it
would ignore differences in whitespace, it was also harder to read/edit.
This commit is contained in:
Daniel Gorin 2020-06-24 18:01:21 +01:00 committed by Robert Helgesson
parent 223e3c38a1
commit 861690ff29
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -16,17 +16,10 @@ with lib;
};
};
nmt.script = let
lineStart =
"^add-highlighter\\s\\+global\\/\\?\\s\\+show-whitespaces\\s\\+"
+ "\\(-\\w\\+\\s\\+.\\s\\+\\)*";
in ''
nmt.script = ''
assertFileExists home-files/.config/kak/kakrc
assertFileRegex home-files/.config/kak/kakrc '${lineStart}-lf\s\+1\b'
assertFileRegex home-files/.config/kak/kakrc '${lineStart}-spc\s\+2\b'
assertFileRegex home-files/.config/kak/kakrc '${lineStart}-nbsp\s\+3\b'
assertFileRegex home-files/.config/kak/kakrc '${lineStart}-tab\s\+4\b'
assertFileRegex home-files/.config/kak/kakrc '${lineStart}-tabpad\s\+5\b'
assertFileContains home-files/.config/kak/kakrc \
"add-highlighter global/ show-whitespaces -tab 4 -tabpad 5 -spc 2 -nbsp 3 -lf 1"
'';
};
}