Skip to content

Commit

Permalink
Fix persistent others tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgpinto committed Apr 8, 2024
1 parent 84ad88e commit 94ad1c8
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions tests/system-defaults-write.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
system.defaults.dock.appswitcher-all-displays = false;
system.defaults.dock.autohide-delay = 0.24;
system.defaults.dock.orientation = "left";
system.defaults.dock.persistent-apps = ["MyApp.app" "Cool.app"];
system.defaults.dock.persistent-apps = ["~/Documents" "~/Downloads"];
system.defaults.dock.persistent-apps = [ "MyApp.app" "Cool.app" ];
system.defaults.dock.persistent-others = [ "~/Documents" "~/Downloads" ];
system.defaults.screencapture.location = "/tmp";
system.defaults.screensaver.askForPassword = true;
system.defaults.screensaver.askForPasswordDelay = 5;
Expand All @@ -64,24 +64,25 @@
system.defaults.ActivityMonitor.SortDirection = 0;
system.defaults.ActivityMonitor.OpenMainWindow = true;
system.defaults.CustomUserPreferences = {
"NSGlobalDomain" = { "TISRomanSwitchState" = 1; };
"com.apple.Safari" = {
"com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" =
true;
};
"NSGlobalDomain" = { "TISRomanSwitchState" = 1; };
"com.apple.Safari" = {
"com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" =
true;
};
test = lib.strings.concatMapStringsSep "\n" (x: ''
echo >&2 "checking defaults write in /${x}"
${pkgs.python3}/bin/python3 <<EOL
import sys
from pathlib import Path
fixture = '${./fixtures/system-defaults-write}/${x}.txt'
out = '${config.out}/${x}'
if Path(fixture).read_text() not in Path(out).read_text():
print("Did not find content from %s in %s" % (fixture, out), file=sys.stderr)
sys.exit(1)
EOL
'') [
};
test = lib.strings.concatMapStringsSep "\n"
(x: ''
echo >&2 "checking defaults write in /${x}"
${pkgs.python3}/bin/python3 <<EOL
import sys
from pathlib import Path
fixture = '${./fixtures/system-defaults-write}/${x}.txt'
out = '${config.out}/${x}'
if Path(fixture).read_text() not in Path(out).read_text():
print("Did not find content from %s in %s" % (fixture, out), file=sys.stderr)
sys.exit(1)
EOL
'') [
"activate"
"activate-user"
];
Expand Down

0 comments on commit 94ad1c8

Please sign in to comment.