source: tests/collections/.in/string-istream-manip.txt @ 8cffa4f

Last change on this file since 8cffa4f was 8cffa4f, checked in by Michael Brooks <mlbrooks@…>, 8 months ago

Support match-failure reporting for string input.

On failed match, assign the empty-string value to the target.
Prior handling did not modify the target,
which in context like char s[10]; sin | exclude("\n", s);,
left s uninitialized, and invalid for strlen, when the input's next character is a newline.
In this case, scanf offers the return value, the count of output arguments written,
to say, "I did not write to your buffer," a feature lost in the pipe abstraction.

Add tests to exercise such cases.

(Prior "leave uninitialized" treatment was discovered by surprise, while debugging a test program for an upcoming commit.)

  • Property mode set to 100644
File size: 216 bytes
Line 
1abc
2cccccb
3xx
4abcxxx
5abcyyy
6aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww
7uuuuuccccuuuuu
8abc
9cccccb
10xx
11abcxxx
12abcyyy
13aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww
14uuuuuccccuuuuu
Note: See TracBrowser for help on using the repository browser.