tests/starship: add no settings and presets tests

Help catch future regressions

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2026-02-26 21:57:47 -06:00
parent 3113094428
commit 2a39b0828b
3 changed files with 39 additions and 0 deletions

View file

@ -1,5 +1,7 @@
{
starship-settings = ./settings.nix;
starship-no-settings = ./no-settings.nix;
starship-presets = ./presets.nix;
starship-fish-with-transience = ./fish_with_transience.nix;
starship-fish-without-transience = ./fish_without_transience.nix;
starship-fish-with-interactive = ./fish_with_interactive.nix;

View file

@ -0,0 +1,7 @@
{
programs.starship.enable = true;
nmt.script = ''
assertPathNotExists home-files/.config/starship.toml
'';
}

View file

@ -0,0 +1,30 @@
{ pkgs, ... }:
let
starshipPackage = pkgs.runCommand "starship-test-package" { } ''
mkdir -p "$out/share/starship/presets"
cat > "$out/share/starship/presets/nerd-font-symbols.toml" <<'EOF'
format = "$all"
[directory]
style = "blue"
EOF
'';
in
{
programs.starship = {
enable = true;
package = starshipPackage;
presets = [ "nerd-font-symbols" ];
settings = {
add_newline = false;
scan_timeout = 10;
};
};
nmt.script = ''
assertFileExists home-files/.config/starship.toml
assertFileContains home-files/.config/starship.toml 'format = "$all"'
assertFileContains home-files/.config/starship.toml 'style = "blue"'
assertFileContains home-files/.config/starship.toml "add_newline = false"
assertFileContains home-files/.config/starship.toml "scan_timeout = 10"
'';
}