summaryrefslogtreecommitdiffstats
path: root/tests/011
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-11 07:23:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-11 07:23:12 -0700
commitfe4652d2925bd7a2296a6c527c49bd047f78febc (patch)
treeb0f140ab230d119609525a43518636cfa078fcbf /tests/011
parente781c2a91c245bbbc3607b6b16498d99f14ea36b (diff)
downloadtxr-fe4652d2925bd7a2296a6c527c49bd047f78febc.tar.gz
txr-fe4652d2925bd7a2296a6c527c49bd047f78febc.tar.bz2
txr-fe4652d2925bd7a2296a6c527c49bd047f78febc.zip
pic: test cases and fixes.
* share/txr/stdlib/pic.tl (expand-pic-num): Bug: when a field overflows, the (rest ...) call truncates the leftmost digit. A failing test case is (pic "#.#" 12) which produces "2.0" instead of "12.0". Firstly, we only need that logic at all in the zero padding case. When the number is positive, we stick in the + request, so we are sure to get a + character. The rest call then predictably chops off the + rather than a digit. (pic-join-opt): Fix two bugs here in the string-string combine case: using s2 instead of s1, and not splicing in rest. (expand-pic, pic): Implement tightening for escape sequences. If ~ is not followed by anything, or not followed by the documented characters for escaping, it is erroneous. * format.tl: Battery of new tests.
Diffstat (limited to 'tests/011')
0 files changed, 0 insertions, 0 deletions