From 6f2f3d73397c515fc609e6dc078fbe3ba2bdd7ed Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Sun, 23 Aug 2026 17:44:45 -0700 Subject: [PATCH] Fix testpost.jet: cgi="true" doesn't match __jet.cpp's cgi=="yes" check $[^session] (a cookie lookup, global.cookies.data[name]) was always empty because __jet.cpp's cgi keyword check compares against "yes" (a deliberate choice from an earlier session, not the codebase-wide true/false convention used by filterblanklines/trimlines/eval etc.) - testpost.jet had cgi="true", a stale mismatch that predates that decision, so the entire cgi block (including reading HTTP_COOKIE into global.cookies) never ran at all. Fixed the test fixture to say cgi="yes" to match. Verified live via tests/posttest.sh against the current build: $[^session] now correctly prints 18fd56a83f (posttest.sh's simulated HTTP_COOKIE session id), and dump.txt's *** COOKIES *** section shows session=[18fd56a83f] instead of empty. dump.txt committed with this fresh, correct output. Co-Authored-By: Claude Sonnet 5 --- tests/dump.txt | 28 +++------------------------- tests/testpost.jet | 8 ++++++-- 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/tests/dump.txt b/tests/dump.txt index 411bcbe..056dde7 100644 --- a/tests/dump.txt +++ b/tests/dump.txt @@ -1,30 +1,8 @@ *** CGI VARIABLES *** *** GLOBAL VARIABLES *** -=[xxx] -addition=[8] -complete=[ABCD;tohex] -division=[1.666666666667] -divisor=[8] -error=[64] -exprnumbers=[0123456789] -include=[yes] -ix=[1] -lefty=[01234] -modified1=[ABCD] -multiplication=[15] -nested=[64] -newname=[another container value] -noeval=[this is the value store in $[%name1].] -numbers=[0123456789] -subtraction=[2] -theexpr=[bcd] -thename=[this is the value store in .] -tohex=[tohex] -varname1=[vardata] *** LOCAL VARIABLES *** -localvar=[This is a container set with ''] -testinclude=[xThis is a container set with ''x] *** KEYWORD VALUES *** -file=[./testinclude.jet] -name1=[] +cgi=[yes] +sessiondir=[.] *** COOKIES *** +session=[18fd56a83f] diff --git a/tests/testpost.jet b/tests/testpost.jet index f2e081a..a28b649 100755 --- a/tests/testpost.jet +++ b/tests/testpost.jet @@ -1,6 +1,10 @@ #!../jet-2.0 +zzz - -$[^session] + +xxx +!!!$[^session]!!! +xxx +zzz \ No newline at end of file