Ignore:
Timestamp:
Jan 24, 2024, 11:58:10 AM (5 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
3db78b89
Parents:
71b5aad5
Message:

Fix analysis error in string-input testing.

Add comments correlating .in file content with line of code that reads it.

This test's correctness expectation is bootstrapped from the actual behaviour of scanf.
A mistake in knowing "which character are we on at this point"
led to an inaccurate understanding of what scanf does on an edge case.
The test was showing that the CFA analogs behave the same as scanf.
But the test was not exercising the case that it suggested it was.
This issue is now fixed.

Old position, mistaken: case 14 begins on line ccccuuuucccc
Old position, corrected: cases 12/13 consume leading cccc; case 14 begins on uuuucccc
New positions: as commented in test .cfa

prior scanf understanding, mistaken: include skips unwanted characters before capturing
wanted characters, while exclude fails on unwanted characters

scanf understanding, corrected: include and exclude fail on unwanted characters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/collections/string-istream-manip.cfa

    r71b5aad5 r8a33777  
    165165        sin | ignore( incl( "abc", wdi( 8, s ) ) );     sout | "12" | s;
    166166        sin | ignore( excl( "abc", wdi( 8, s ) ) );     sout | "13" | s;
     167                sin | "\n";
    167168
    168169                s = "q";
     
    191192        sin | ignore( incl( "abc", wdi( 8, s ) ) );     sout | "12" | s;
    192193        sin | ignore( excl( "abc", wdi( 8, s ) ) );     sout | "13" | s;
     194                sin | "\n";
    193195
    194196                s = "q";
Note: See TracChangeset for help on using the changeset viewer.