File:  [parser3project] / parser3 / tests / cache / page.html
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Wed Nov 25 22:57:39 2026 UTC (37 hours, 17 minutes ago) by moko
Branches: MAIN
CVS tags: HEAD
test for ^cache[] added (related to feature #1153)

# ^cache under parallel requests, called by run_tests.sh, the parameters are in the query string:
#   expires, extend - the lifespan and $.extend in seconds
#   sleep           - how long the code runs
#   fail            - the code throws
#   text            - what the code returns
#   cache           - the cache file name, cache.bin by default

@main[]
$file[^if(def $form:cache){$form:cache}{cache.bin}]
^if(def $form:extend){
	^cache[$file][ $.expires($form:expires) $.extend($form:extend) ]{^body[]}
}{
	^cache[$file]($form:expires){^body[]}
}

# every run is logged, to count them
@body[]
$run[run^#0A]
^run.save[append;runs.txt]
^sleep($form:sleep)
^if(def $form:fail){^throw[test;;generation failed]}
$result[$form:text]

E-mail: