Skip to content

Commit 4aa05ee

Browse files
committed
tests(kanshi): fix check evaluation and assert injected config path
1 parent b60341f commit 4aa05ee

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

modules/kanshi/check.nix

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,29 @@
44
}:
55

66
let
7-
kanshiApplied = self.wrapperModules.kanshi.apply {
8-
inherit pkgs;
7+
kanshiConfig = pkgs.writeText "kanshi-test-config" ''
8+
profile {
9+
output eDP-1 enable scale 2
10+
}
11+
'';
912

10-
configFile.content = ''
11-
profile {
12-
output eDP-1 enable scale 2
13-
}
14-
'';
15-
};
16-
17-
kanshiWrapped = kanshiApplied.wrapper;
18-
kanshiConfigPath = toString kanshiApplied.config.configFile.path;
13+
kanshiWrapped =
14+
(self.wrapperModules.kanshi.apply {
15+
inherit pkgs;
16+
configFile.path = toString kanshiConfig;
17+
}).wrapper;
1918

2019
in
2120
pkgs.runCommand "kanshi-test" { } ''
2221
help_output="$(${kanshiWrapped}/bin/kanshi --help 2>&1)"
2322
[[ "$help_output" == *config* ]]
2423
25-
test -f "${kanshiConfigPath}"
26-
grep -qF 'output eDP-1 enable scale 2' "${kanshiConfigPath}"
24+
test -f "${kanshiConfig}"
25+
grep -qF 'output eDP-1 enable scale 2' "${kanshiConfig}"
2726
2827
wrapper_script=$(<"${kanshiWrapped}/bin/kanshi")
2928
[[ "$wrapper_script" == *"--config"* ]]
30-
[[ "$wrapper_script" == *"${kanshiConfigPath}"* ]]
29+
[[ "$wrapper_script" == *"${kanshiConfig}"* ]]
3130
3231
touch $out
3332
''

0 commit comments

Comments
 (0)