mirror of
https://github.com/lucannez64/darling-lol.git
synced 2026-10-26 19:47:42 +00:00
docs(tests): document fontconfig regression helpers
This commit is contained in:
1 parent
a089a23072
commit
eb962b8c9f
2 files changed
+6
No files matched your search
@@ -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)
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user