aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gorin <jcpetruzza@gmail.com>2020-06-24 18:01:21 +0100
committerRobert Helgesson <robert@rycee.net>2020-08-12 22:43:38 +0200
commit861690ff29c146172b15aa13188392c295e7f6a9 (patch)
tree8a6f007f77caa5f0b49bee72488f5bbfb92f3f72
parent223e3c38a13fb45726c7a9d97e2612ae53ab4f98 (diff)
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.
-rw-r--r--tests/modules/programs/kakoune/whitespace-highlighter.nix13
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/modules/programs/kakoune/whitespace-highlighter.nix b/tests/modules/programs/kakoune/whitespace-highlighter.nix
index 3ce02e8f5af..edeb6b52d72 100644
--- a/tests/modules/programs/kakoune/whitespace-highlighter.nix
+++ b/tests/modules/programs/kakoune/whitespace-highlighter.nix
@@ -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"
'';
};
}