»
« home   paste   Anonymous | Login | Signup for a new account 05-22-2019 21:04 CEST
 
* X »
«
GeSHi - Generic Syntax Highlighter Syntax Coloriser for PHP
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000087 [GeSHi] core minor always 07-31-06 20:59 07-31-06 22:45
Reporter nigel View Status public  
Assigned To nigel
Priority normal Resolution open Platform
Status assigned   OS
Projection none   OS Version
ETA none Fixed in Version Product Version
  Product Build
Summary 0000087: Test cases for single character strings
Description 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
expressed as:
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
        ENDDELIM.
 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
Additional Information
Attached Files  class.geshisinglecharcontext.testcases [^] (13,530 bytes) 07-31-06 22:41

- Relationships

- Notes
(0000418)
Netocrat
07-31-06 22:45

I've extended it to include C-specific test cases - some are missing due to inapplicability to C. The section "Accumulated C test cases" can be pasted into a MediaWiki page when GeSHi is installed as an extension to process <c></c> tags. Currently all appears as expected on my development setup.
 

- Issue History
Date Modified Username Field Change
07-31-06 20:59 nigel New Issue
07-31-06 20:59 nigel Status new => assigned
07-31-06 20:59 nigel Assigned To  => nigel
07-31-06 22:41 Netocrat File Added: class.geshisinglecharcontext.testcases
07-31-06 22:45 Netocrat Note Added: 0000418

  


Mantis 1.0.0rc2[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker