diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/testsuite.at | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at index 95c1336..074e973 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -123,6 +123,11 @@ TE_CHECK([[1@O/foo,bar/ (0/0) !bar!]], 0, ignore, ignore) TE_CHECK([[-1@O/foo/ 1@O/foo/ @O/,foo/]], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Conditionals]) +# FIXME: Add more test cases +TE_CHECK([[0"N(0/0)F"]], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([String arguments]) TE_CHECK([[Ifoo^Q]]TE_ESCAPE[[(0/0)]]TE_ESCAPE, 0, ignore, ignore) TE_CHECK([[@I"foo^Q"(0/0)"]], 0, ignore, ignore) @@ -254,6 +259,10 @@ TE_CHECK([[10^T]], 0, stdout, ignore) TE_CHECK([[16,0ED @EB/stdout/ Z-1"N(0/0)' 0A-10"N(0/0)']], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Get character code]) +TE_CHECK([[@I/ABC/ 1J -A-^^A"N(0/0)' A-^^B"N(0/0)' 1A-^^C"N(0/0)']], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Convert between line and glyph positions]) TE_CHECK([[@I/1^J2^J3/J 2^QC :^Q-3"N(0/0)']], 0, ignore, ignore) AT_CLEANUP @@ -274,15 +283,15 @@ TE_CHECK([[@EB'words-example.txt' Z-4J 2Y .-18"N(0/0)' 2C @Y Z-19"N(0/0)']], 0, AT_CLEANUP AT_SETUP([Searches]) -# FIXME: We cannot currently easily insert a single ASCII 5 (^E), as it must be followed -# by a 2nd character. It can be quoted, but cannot be written as Caret+E. -# You also cannot search for a single ASCII 5 using Caret+E. -# 2 additional ^Q are translated to a single ^Q and interpreted at the search-pattern layer. -TE_CHECK(m4_format([[@I/^Q%c/ J @:S/^Q^Q^Q%c/"F(0/0)']], 5, 5), 0, ignore, ignore) +# Searching for ^E (5) +TE_CHECK([[5@I// J @:S/^Q^Q^E<5>/"F(0/0)']], 0, ignore, ignore) +TE_CHECK([[@I/АБВГД/ J :@S/в/"F(0/0)' .-3"N(0/0)']], 0, ignore, ignore) # Canse-sensitive search TE_CHECK([[@I/XXX/J -^X @:S/xxx/"S(0/0)']], 0, ignore, ignore) +TE_CHECK([[@I/АБВГД/J -^X :@S/в/"S(0/0)']], 0, ignore, ignore) # Search mode should be local to the macro frame. TE_CHECK([[-^X @^Um{^X} Mm-0"N(0/0)']], 0, ignore, ignore) +# Anchored search TE_CHECK([[@I/XYZ/ J ::@S/X/"F(0/0)' H::@S/Z/"S(0/0)']], 0, ignore, ignore) AT_CLEANUP @@ -312,6 +321,13 @@ AT_DATA([test.txt], [[0123456789 TE_CHECK([[@ER"test.txt" ^S+11"N(0/0)']], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Globbing]) +# This is from the source tree - there should be plenty of lexers +TE_CHECK([[1@EN|^EN[$SCITECOPATH]/lexers/*.tes|| ."=(0/0)' :^Q-50"<(0/0)']], 0, ignore, ignore) +TE_CHECK([[1:@EN|^EN[$srcdir]/*.in||"F(0/0)']], 0, ignore, ignore) +TE_CHECK([[:@EN/[аб]?/бЖ/"F(0/0)']], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Macro calls]) TE_CHECK([[@^Ua{-$$} Ma+1"N(0/0)']], 0, ignore, ignore) AT_CLEANUP @@ -387,6 +403,11 @@ TE_CHECK([[0EE 255@I/A/J 65001EE 0A-(-2)"N(0/0)' 1A-^^A"N(0/0)' 2A-(-1)"N(0/0)'] TE_CHECK([[@EQa// 0EE 128@I/A/J 65001EE 0Qa-(-2)"N(0/0)' 1Qa-^^A"N(0/0)' 2Qa-(-1)"N(0/0)']], 0, ignore, ignore) AT_CLEANUP +AT_SETUP([Glyphs to byte heuristics]) +# Should be fast. +TE_CHECK([[100000<@I"Ж"> J<:C;> J<.-1:J;> .*2-^E"N(0/0)']], 0, ignore, ignore) +AT_CLEANUP + AT_SETUP([Automatic EOL normalization]) TE_CHECK([[@EB'^EQ[$srcdir]/autoeol-input.txt' EL-2"N(0/0)' 2LR 13@I'' 0EL @EW'autoeol-sciteco.txt']], 0, ignore, ignore) @@ -462,6 +483,13 @@ TE_CHECK_CMDLINE([[{0EE 255@I//}]], 0, ignore, stderr) AT_FAIL_IF([! $GREP "^Error:" stderr]) AT_CLEANUP +AT_SETUP([Save last command-line]) +TE_CHECK_CMDLINE([[!hello!$$*m :Gm]], 0, stdout, ignore) +AT_FAIL_IF([! $GREP "!hello!" stdout]) +TE_CHECK_CMDLINE([[!hello!$$ E*m :Gm]], 0, stdout, ignore) +AT_FAIL_IF([! $GREP "!hello!" stdout]) +AT_CLEANUP + AT_BANNER([Standard library]) AT_SETUP([Option parser]) @@ -535,9 +563,7 @@ AT_CLEANUP # It could fail because the memory limit is exceeed, # but not in this case since the match string isn't too large. AT_SETUP([Pattern matching overflow]) -# NOTE: Creating very long lines would currently be ineffective -# at least in UTF-8 mode. -TE_CHECK([[100000<@I"^J">J @S"^EM^X"]], 0, ignore, ignore) +TE_CHECK([[100000<@I"X">J @S"^EM^X"]], 0, ignore, ignore) AT_CLEANUP AT_SETUP([Block-wise backwards search]) |
