File tree Expand file tree Collapse file tree 8 files changed +24
-16
lines changed
Expand file tree Collapse file tree 8 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 3131in
3232pkgs . runCommand "ghostty" { } ''
3333 "${ ghosttyWrapped } /bin/ghostty" +validate-config
34- " $ {ghosttyWrapped } /bin/ghostty" +version | grep -q "${ ghosttyWrapped . version } "
34+ [[ "$( $ {ghosttyWrapped } /bin/ghostty +version)" == * "${ ghosttyWrapped . version } "* ]]
3535
3636 "${ ghosttyFileWrapped } /bin/ghostty" +validate-config
3737
Original file line number Diff line number Diff line change 1717
1818in
1919pkgs . runCommand "git-test" { } ''
20- " $ {gitWrapped } /bin/git" --version | grep -q " git"
20+ [[ "$( $ {gitWrapped } /bin/git --version)" == * git* ]]
2121 touch $out
2222''
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pkgs.runCommand "i3-test" { nativeBuildInputs = [ pkgs.dbus ]; } ''
2424 dbus-daemon --session --address="$DBUS_SESSION_BUS_ADDRESS" --nofork --nopidfile --print-address &
2525 DBUS_PID=$!
2626
27- " $ {i3Wrapped } /bin/i3" --version | grep -q "${ i3Wrapped . version } "
27+ [[ "$( $ {i3Wrapped } /bin/i3 --version)" == * "${ i3Wrapped . version } "* ]]
2828
2929 kill $DBUS_PID 2>/dev/null || true
3030
Original file line number Diff line number Diff line change 1616 } ) . wrapper ;
1717in
1818pkgs . runCommand "jujutsu-test" { } ''
19- "${ jujutsuWrapped } /bin/jj" config list --user | grep -q 'user.name = "Test User"'
20- "${ jujutsuWrapped } /bin/jj" config list --user | grep -q 'user.email = "test@example.com"'
19+ config_list="$(${ jujutsuWrapped } /bin/jj config list --user)"
20+ [[ "$config_list" == *'user.name = "Test User"'* ]]
21+ [[ "$config_list" == *'user.email = "test@example.com"'* ]]
2122 touch $out
2223''
Original file line number Diff line number Diff line change 44} :
55
66let
7+ kanshiConfig = pkgs . writeText "kanshi-test-config" ''
8+ profile {
9+ output eDP-1 enable scale 2
10+ }
11+ '' ;
12+
713 kanshiWrapped =
814 ( self . wrapperModules . kanshi . apply {
915 inherit pkgs ;
10-
11- configFile . content = ''
12- profile {
13- output eDP-1 enable scale 2
14- }
15- '' ;
16-
16+ configFile . path = toString kanshiConfig ;
1717 } ) . wrapper ;
1818
1919in
2020pkgs . runCommand "kanshi-test" { } ''
21+ help_output="$(${ kanshiWrapped } /bin/kanshi --help 2>&1)"
22+ [[ "$help_output" == *config* ]]
23+
24+ test -f "${ kanshiConfig } "
25+ grep -qF 'output eDP-1 enable scale 2' "${ kanshiConfig } "
2126
22- "${ kanshiWrapped } /bin/kanshi" --help 2>&1 | grep -q "config"
27+ wrapper_script=$(<"${ kanshiWrapped } /bin/kanshi")
28+ [[ "$wrapper_script" == *"--config"* ]]
29+ [[ "$wrapper_script" == *"${ kanshiConfig } "* ]]
2330
2431 touch $out
2532''
Original file line number Diff line number Diff line change 1515
1616in
1717pkgs . runCommand "mpv-test" { } ''
18- " $ {mpvWrapped } /bin/mpv" --version | grep -q " mpv"
18+ [[ "$( $ {mpvWrapped } /bin/mpv --version)" == * mpv* ]]
1919 touch $out
2020''
Original file line number Diff line number Diff line change 111111in
112112pkgs . runCommand "niri-test" { } ''
113113 cat ${ niriWrapped } /bin/niri
114- " $ {niriWrapped } /bin/niri" --version | grep -q "${ niriWrapped . version } "
114+ [[ "$( $ {niriWrapped } /bin/niri --version)" == * "${ niriWrapped . version } "* ]]
115115 "${ niriWrapped } /bin/niri" validate
116116 # since config is now checked at build time, testing a bad config is impossible
117117 touch $out
Original file line number Diff line number Diff line change 1616 } ) . wrapper ;
1717in
1818pkgs . runCommand "udiskie-test" { } ''
19- " $ {udiskieWrapped } /bin/udiskie" --version | grep -q " udiskie"
19+ [[ "$( $ {udiskieWrapped } /bin/udiskie --version)" == * udiskie* ]]
2020 touch $out
2121''
You can’t perform that action at this time.
0 commit comments