diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-12 08:04:44 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-12 08:04:44 +0300 |
| commit | aff74bffb00f1be36f218db52dd76fd1fd8549f9 (patch) | |
| tree | ef8ebb7a4fdb8a5819877af3eedaa523a2545596 /tests/cli.sh | |
| parent | c9d9394146e617bfcdce3eb93ec70aeccb5eddb8 (diff) | |
Fix next template required vars for gm0
Diffstat (limited to 'tests/cli.sh')
| -rwxr-xr-x | tests/cli.sh | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/tests/cli.sh b/tests/cli.sh index 0b72a69..66fdf82 100755 --- a/tests/cli.sh +++ b/tests/cli.sh @@ -3092,20 +3092,46 @@ 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' + expected=$(cat <<'END' +details:animation_class backhref exif_details exif_tooltip html_dir page_num photo photos_dir preview_num +footer:backhref html_dir tarball_name +header:backhref background_image blurs_dir html_dir show_header_bar +next:html_dir next +prev:html_dir prev +preview:animation_class backhref html_dir page_num photo preview_num thumbs_dir +redirect:html_dir redirect_page +splash:backhref background_image blurs_dir enter_page html_dir photo photos_dir +view:animation_class backhref html_dir page_num photo photos_dir preview_num +END + ) output=$( bash -euo pipefail -s "$TEST_REPO_ROOT" <<'BASH' repo_root="$1"; shift +template_name='' +declare -a template_names=( + details + footer + header + next + prev + preview + redirect + splash + view +) # shellcheck source=src/lib/template.source.sh source "$repo_root/src/lib/template.source.sh" -template_required_context_vars preview +for template_name in "${template_names[@]}"; do + printf '%s:' "$template_name" + template_required_context_vars "$template_name" | paste -sd ' ' - +done BASH ) if [ "$output" != "$expected" ]; then - printf 'FAIL: unexpected preview required render variables\n' >&2 + printf 'FAIL: unexpected template required render variables\n' >&2 printf 'expected:\n%s\n' "$expected" >&2 printf 'actual:\n%s\n' "$output" >&2 exit 1 |
