summaryrefslogtreecommitdiff
path: root/tests/cli.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-06-12 07:57:00 +0300
committerPaul Buetow <paul@buetow.org>2026-06-12 07:57:00 +0300
commitc9d9394146e617bfcdce3eb93ec70aeccb5eddb8 (patch)
treeaa43022ea8dd8ce9700fa9f4b791f4c0272d8832 /tests/cli.sh
parent8a2a442f6f10f303ec06a658958210fd3da84678 (diff)
Co-locate template required context vars for gm0
Diffstat (limited to 'tests/cli.sh')
-rwxr-xr-xtests/cli.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/cli.sh b/tests/cli.sh
index 4ed264e..0b72a69 100755
--- a/tests/cli.sh
+++ b/tests/cli.sh
@@ -3088,6 +3088,30 @@ test_generate_templates_cannot_read_serialized_context_hook() {
test::teardown
}
+test_template_required_context_vars_come_from_render_specs() {
+ local expected
+ local output
+
+ expected=$'animation_class\nbackhref\nhtml_dir\npage_num\nphoto\npreview_num\nthumbs_dir'
+ output=$(
+ bash -euo pipefail -s "$TEST_REPO_ROOT" <<'BASH'
+repo_root="$1"; shift
+
+# shellcheck source=src/lib/template.source.sh
+source "$repo_root/src/lib/template.source.sh"
+
+template_required_context_vars preview
+BASH
+ )
+
+ if [ "$output" != "$expected" ]; then
+ printf 'FAIL: unexpected preview required render variables\n' >&2
+ printf 'expected:\n%s\n' "$expected" >&2
+ printf 'actual:\n%s\n' "$output" >&2
+ exit 1
+ fi
+}
+
test_generate_swap_failure_restores_dist() {
local config_file
local fake_bin
@@ -3967,6 +3991,9 @@ main() {
'--generate templates cannot read serialized context hook' \
test_generate_templates_cannot_read_serialized_context_hook
test::run_case \
+ 'template required context vars come from render specs' \
+ test_template_required_context_vars_come_from_render_specs
+ test::run_case \
'--generate swap failure restores final dist' \
test_generate_swap_failure_restores_dist
test::run_case \