diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-11 23:52:49 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-11 23:52:49 -0500 |
| commit | b0ca38bc98f240e208edd08009856ab6de62c227 (patch) | |
| tree | 0412890e4480ade5e954104d428178bba3f4e64c /tests/gallery-tokens | |
| parent | b137223e76c75217b594bc5e46e7625b10e31b0f (diff) | |
| download | archsetup-b0ca38bc98f240e208edd08009856ab6de62c227.tar.gz archsetup-b0ca38bc98f240e208edd08009856ab6de62c227.zip | |
refactor(gallery): rename generated tokens.el to gallery-tokens.el
The generated file declares (provide 'gallery-tokens), but `require` resolves a feature by filename, so as tokens.el it could never load from a load-path. The name now matches the feature. gen_tokens.py, the renderer's load, and the README follow.
Diffstat (limited to 'tests/gallery-tokens')
| -rw-r--r-- | tests/gallery-tokens/test_gen_tokens.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/gallery-tokens/test_gen_tokens.py b/tests/gallery-tokens/test_gen_tokens.py index 414194e..b9fbb50 100644 --- a/tests/gallery-tokens/test_gen_tokens.py +++ b/tests/gallery-tokens/test_gen_tokens.py @@ -210,6 +210,16 @@ class RealTokensJson(unittest.TestCase): self.assertIn("pulse-rate", self.tokens["timing"]) +class DefaultElispFilename(unittest.TestCase): + """The default elisp target must be gallery-tokens.el so that the file's + (provide 'gallery-tokens) matches its name and `require` can resolve it + from a load-path. A tokens.el/gallery-tokens feature mismatch is a trap.""" + + def test_default_elisp_path_matches_provided_feature(self): + self.assertEqual( + os.path.basename(gt.DEFAULT_ELISP_NAME), "gallery-tokens.el") + + class MainIntegration(unittest.TestCase): """main() rewrites the html :root and writes the waybar + elisp files.""" @@ -218,7 +228,7 @@ class MainIntegration(unittest.TestCase): self.html = os.path.join(self.tmp, "gallery.html") self.tokens_path = os.path.join(self.tmp, "tokens.json") self.waybar = os.path.join(self.tmp, "tokens-waybar.css") - self.elisp = os.path.join(self.tmp, "tokens.el") + self.elisp = os.path.join(self.tmp, "gallery-tokens.el") with open(self.tokens_path, "w") as f: json.dump(FIXTURE, f) with open(self.html, "w") as f: |
