From eb962b8c9f385c393a651c1dade4bcbf027830b1 Mon Sep 17 00:00:00 2001 From: Nicolai Bruns Date: Tue, 20 Oct 2026 13:43:22 +0200 Subject: [PATCH] docs(tests): document fontconfig regression helpers --- tests/test_nix_fonts.py | 5 +++++ tests/test_nix_repairs.py | 1 + 2 files changed, 6 insertions(+) diff --git a/tests/test_nix_fonts.py b/tests/test_nix_fonts.py index 0f084f1..ac0e5ae 100644 --- a/tests/test_nix_fonts.py +++ b/tests/test_nix_fonts.py @@ -9,6 +9,7 @@ from pathlib import Path REPO_ROOT = Path(__file__).resolve().parent.parent def extract_fhs_profile(flake_text: str) -> str: + """Extract the FHS shell profile, substituting inert paths for Nix values.""" match = re.search(r"profile\s*=\s*''(.*?)'';", flake_text, re.DOTALL) if not match: raise ValueError("Could not find profile in flake.nix") @@ -19,7 +20,10 @@ def extract_fhs_profile(flake_text: str) -> str: return profile_script class NixFontsConfigTest(unittest.TestCase): + """Check packaged font configuration and isolation from host overrides.""" + def test_flake_font_configuration(self): + """Require bundled text fonts, user font support, and ordered sanitization.""" flake_text = (REPO_ROOT / "flake.nix").read_text(encoding="utf-8") # Flake must bundle both font families in darlingFontsConf @@ -41,6 +45,7 @@ class NixFontsConfigTest(unittest.TestCase): self.assertLess(unset_pos, export_pos, "unset must happen before export FONTCONFIG_FILE") def test_fhs_profile_hostile_environment_sanitization(self): + """Clear hostile fontconfig overrides while preserving user XDG settings.""" flake_text = (REPO_ROOT / "flake.nix").read_text(encoding="utf-8") profile_script = extract_fhs_profile(flake_text) diff --git a/tests/test_nix_repairs.py b/tests/test_nix_repairs.py index 6db36e9..09ebb58 100644 --- a/tests/test_nix_repairs.py +++ b/tests/test_nix_repairs.py @@ -440,6 +440,7 @@ class SessionTests(unittest.TestCase): self.assertFalse((root / 'other-prefix').exists()) def test_first_run_eof_is_actionable_and_desktop_requests_terminal(self): + """Report missing terminal input without setup and package a terminal launcher.""" with tempfile.TemporaryDirectory(prefix='nix-session-test-') as directory: root = Path(directory) (root / 'scripts').mkdir()