GeSHi Bug Tracker - GeSHi
|Viewing Issue Advanced Details|
|ID:||Category:||Severity:||Reproducibility:||Date Submitted:||Last Update:|
|87||core||minor||always||07-31-06 20:59||07-31-06 22:45|
|ETA:||none||Fixed in Version:|
|Summary:||0000087: Test cases for single character strings|
Netocrat and I have hashed out a few test cases for single characters that I at least should make test cases for on my machine.
The cases are as follows (composed by Netocrat):
Here's an attempt at more precisely describing the scheme, with
additional coverage. First, define:
* UNESC: a single character that's not part of an escape sequence i.e.
is not preceded by ESC nor part of a VALESC that's preceded by ESC.
* ESC: an escape character
* VALESC: a character sequence that is valid as an escape sequence (this
doesn't include any possible preceding ESC)
* INVALESC: a (minimal) character sequence that is not valid as an
escape sequence (this also doesn't include any possible preceding ESC).
"Minimal" means that when splitting up "abcd" where neither that string
nor any substring in it could be a VALESC, if the first component is to
be an INVALESC, then it can only be one character in length i.e. "a".
* STARTDELIM: a (maximal) valid start delimiter
* ENDDELIM: a valid end delimiter.
Your existing test cases (with a small extension to the first and a
limitation to the fifth) and my suggested additions can then be
1. STARTDELIM ENDDELIM
1a. disallowEmptyChars has been set true. Expect highlighting? no
1b. disallowEmptyChars has been set false. Expect highlighting? yes
1c. disallowEmptyChars has not been set (defaults false).
Expect highlighting? yes
2. STARTDELIM UNESC ENDDELIM. Expect highlighting? yes
3. STARTDELIM UNESC UNESC ENDDELIM. Expect highlighting? no
4. STARTDELIM ESC VALESC ENDDELIM.
4a. The VALESC is also an ENDDELIM. Expect highlighting? yes
4b. The VALESC is not also an ENDDELIM. Expect highlighting? yes
4c. The VALESC is also an ESC. Expect highlighting? yes
4d. The VALESC is not also an ESC. Expect highlighting? yes
5. STARTDELIM ESC INVALESC ENDDELIM.
5a. The INVALESC is also an ENDDELIM. Expect highlighting? no
5b. The INVALESC is not also an ENDDELIM. Expect highlighting? no
5c. The INVALESC is also an ESC. Expect highlighting? no
5d. The INVALESC is not also an ESC. Expect highlighting? no
These invalid/unterminated scenarios could aid coverage (the answer to
"expect highlighting?" is "no" for all of these):
6. STARTDELIM ESC ENDDELIM !ENDDELIM
6a. The ENDDELIM is also a VALESC.
6b. The ENDDELIM is not also a VALESC.
7. STARTDELIM UNESC ...
8. STARTDELIM ESC VALESC ...
9. STARTDELIM ESC INVALESC ...
a. ... ESC VALESC ENDDELIM.
b. ... ESC INVALESC ENDDELIM.
c. ... UNESC ENDDELIM. (7c duplicates 3)
d. ... a random mix of ESC, VALESC, INVALESC and UNESC, without any
ENDDELIMs or newlines, for, say, 10 characters, followed by
e. ... as above, but including a single newline in the random mix.
f. ... as above, but including multiple newlines in the random mix and
extending to, say, hundreds of characters.
g. ... as for d, but without an ENDDELIM (i.e. code ends)
h. ... as for e, but without an ENDDELIM (i.e. code ends)
i. ... as for f, but without an ENDDELIM (i.e. code ends)
|Steps To Reproduce:|
|Attached Files:||class.geshisinglecharcontext.testcases [^] (13,530 bytes) 07-31-06 22:41|