aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Add warning when local macros used in attr expression.Kaz Kylheku2023-05-291-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The with-html-output ("WHO") macro defines some local macrolets. Those are in scope of the entire thing, but they can only be meaningfully used in the imperative Lisp forms that are placed into the HTML tag body. If they are used in an attribute expression, it's probably a programming error; an output side effect doesn't belong there. We implement a diagnostic strategy which produces a warning in this situation. * who.tl (attr-warning-macrolet): New function, which wraps macrolet code around the expression passed in. These macrolets intercept the local macros and generate a warning. Then they decline to expand, deferring to the real macros. (convert-attributes): Wrap the warning macrolets around the run-time evaluation of the val expression. We don't do anything for the compile-time evaluation of a constant attribute expression, because the macro calls we want to intercept do not appear in a constant expression. * test/simple.tl: New test 41 validating that warnings are generated for all the local macros when they are called from an attr expression.
* New local macro noesc-fmt; fmt now escapes.Kaz Kylheku2023-05-291-0/+19
| | | | | | | | | | | | | * packages.tl (tl-who): Add noesc-fmt symbol. * who.tl (with-html-output): Add escaping to fmt, which is disabled under *cl-who-compat*. Add noesc-fmt macro that looks like former definition of fmt. * test/simple.tl: New test cases 38-40. * README.md: Mention that TL-WHO provides noesc-fmt.
* Fix CL-WHO attr bugs: no escaping, poor constant handling.Kaz Kylheku2023-05-291-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | CL-WHO tries to handle the case when attribute values are constant NIL and T values, but it bungles it; it applies the correct behavior only when the constants are literally these symbols, not when they are constant expressions which evaluate to these values. Secondly, CL-WHO neglects to HTML-escape attribute values. We fix this behavior and introduce a noesc operator to selectively revert it, as well as a *cl-who-compat* special to revert the behavior more pervasively, for the daredevils. * packages.tl (tl-who): New symbols *cl-who-compat* and noesc. * specials.tl (*cl-who-compat*): New special variable. * who.tl (convert-attributes): When treating a constant expression, evaluate it first, then check for nil or t. Escape interpolated text with html-encode. Check the original expression for (noesc ...) pattern, or the presence of *cl-who-compat*. In these cases, don't generate the escape call. * test/simple.tl: New tests 28 to 37 providing some coverage to all these changes. * README.md: Document.
* Fix another attribute bug: all tests work.Kaz Kylheku2023-05-291-82/+137
| | | | | | | * simple.tl: Translate and enable all tests. * who.tl (process-tag): Fix double nreverse bug causing attr list to be truncated to one tag.
* tests: 9 through 14 working.Kaz Kylheku2023-05-291-89/+90
|
* tests: 7 through 8 working.Kaz Kylheku2023-05-281-15/+14
| | | | * test/simple.tl: Port tests 7 through 8 and move (exit).
* Fix attribute bugs: tests 1 to 7 working.Kaz Kylheku2023-05-281-36/+38
| | | | | | | | | | | * who.tl (convert-attributes): In the run-time case, we must generate code to print the calculated string, not just to calculate it. (convert-tag-to-string-list): Test the original tag keyword against the *html-empty-tags*, not the transformed string. * test/simple.tl: Port and enable tests 1 to 7.
* Starting TL-WHO tests.Kaz Kylheku2023-05-281-14/+26
| | | | | | | * test/simple: renamed to simple.tl. Just a self-contained file we can run. The first test has been rewritten to TL. After that we (exit). The first test is failing; it is not rendering any attributes.
* Fix keyword bloating in DEFPACKAGE clauses (#33)masterKilian M. Haemmerle2022-02-231-1/+1
| | | | | * Fix keyword bloating in DEFPACKAGE :EXPORT clauses * Fix keyword bloating in DEFPACKAGE :SHADOW clause
* *HTML-NO-INDENT-TAGS*Nikodemus Siivola2012-04-091-1/+32
| | | | | | | | Tags in this list don't have their body indented even if *INDENT* is true. <pre> in particular is indentation sensitive, and it's irritating when rendering changes as :indent is flipped.
* fix unportable testsNikodemus Siivola2012-04-091-9/+9
| | | | | | | Previously the tests implicitly assumed that EVAL does macroexpansion at runtime -- which is legal, but not required. Add explicit EVAL calls to tests requiring that.
* more expressive test results for STRING= testsNikodemus Siivola2012-04-091-1/+9
| | | | A bit ugly, but...
* number the tests in source to avoid confusionNikodemus Siivola2012-04-091-0/+23
| | | | | Just spent 20 minutes trying to figure out why a test that wasn't failing was...
* delete trailing whitespaceNikodemus Siivola2012-04-091-1/+1
|
* Dev versionEdi Weitz2009-03-093-0/+424
git-svn-id: svn://bknr.net/svn/trunk/thirdparty/cl-who@4336 4281704c-cde7-0310-8518-8e2dc76b1ff0