I mentioned a couple of days ago that I had written some testcases down on a tablet. I'll include them here (as a brain-dump, for now). My mind does not really think up testcases in any structured sort of way, so this list is likely not to cover all the cases. Some of the cases might also be harsher than our expectations. Usually I better organize the testcases once I start testing, so for now, this is just a brain-dump:

VARY THE VALUES OF "B" (BEFORE) AND "A" (AFTER) A SINGLE-LINE MATCH:
    A=B=0
    A=B=1
A=B=4 # (as many lines as won't flush the print buffer, assuming brint buffer is 10 lines)
    A=B=5   # (as many lines as will flush the print buffer
                 # (even if there is no match, again, assume 10 lines)

    A=1, B > A
    B=1, A > B

    A>numLinesInFile (and expermental variations:  ==, A-1, etc.)
    B>numLinesInFile (and expermental variations:  ==, A-1, etc.)

SINGLE-LINE MATCH NEAR TOP OF FILE PATTERNS:
    match only first line of file with B+A+1 lines (try with B=0,1,>1)
    match only second line of file with B+A+1 lines (try with B=0,1,>1)
    match only third line of file with B+A+1 lines (try with B=0,1,>1)

SINGLE-LINE MATCH NEAR BOTTOM OF FILE PATTERNS:
match only last line of file with B+A+1 lines (try with B=n,n-1,<n-1) match only second-to-last line of file with B+A+1 lines (try with B=n,n-1,<n-1) match only third-to-last line of file with B+A+1 lines (try with B=n,n-1,<n-1)

BASIC MULTIPLE-LINE MATCH/NO-MATCH PATTERNS:

    line
    line
    line

    line
    match
    line

    match
    match
    match

    line
    match
    match
    match
    line

    VARIOUS REPEATS OF ABOVE PATTERNS

MORE CONVOLUTED VALUES OF A AND B:
B=0, vary A (A=1,8,9, and 10 with and with single and double line matches)
    A=0, varb B as above

SPECIAL MATCH CASES
    empty line
    empy consecutive lines
    empty non-consecutive lines
    empty first line
    empty last line

    REPEATS OF MULTIPLE FILES CONTAINING ABOVE

LENGTH OF FILE CASES
1 line, not terminated with newline (both match and not-matched variations)
    repeat above but with newline terminated line

    0 length file (both as a file and as STDIN)

FILE SOURCE:
STDIN (assume piped STDIN, <, and << all are equvalent) TBD: determine if assumption valid
    file
    COMBINED 2 FILES PLUS STDIN (in each order)

MORE CONVOLUTED STUFF:
    FF's (and/or other white space) in file
    unicode or other alternate forms of line separators
    DOS files on UNIX
    UNIX files on DOS
    Apple variations, combinations with above two

--
Bob

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to