Eric Blake <ebl...@redhat.com> writes: > On 11/20/18 11:20 AM, Eric Blake wrote: >> On 11/20/18 11:06 AM, Eric Blake wrote: >>> On 11/20/18 3:25 AM, David Hildenbrand wrote: >>>> Test that very big/small values are not accepted and that ranges with >>>> only one element work. Also test that ranges are ascending and cannot >>>> have more than 65536 elements. >>>> >>>> Rename expect4 to expect5, as we will be moving that to a separate ulist >>>> test after the rework. >>>> >>>> Signed-off-by: David Hildenbrand <da...@redhat.com> >>>> --- >>>> tests/test-string-input-visitor.c | 41 +++++++++++++++++++++++++++++-- >>>> 1 file changed, 39 insertions(+), 2 deletions(-) >>>> >>> >>> Reviewed-by: Eric Blake <ebl...@redhat.com> >> >> Do we also want to test garbage strings like: >> >> "1-" (incomplete range) >> "1X-2" (garbage suffix on first element) >> "1-2X" (garbage suffix on second element) >> >> and/or >> >> "-2--1" (valid range of signed integers) >> "-1--2" (questionable whether this is valid for the two largest >> unsigned integers) > > Or even " 1- 2" (we permit leading whitespace for plain integers - do > we also permit it in both sides of a range)? Also, if we permit > whitespace after the range '-', should we permit it beforehand?
For what it's worth, the tests for integers (as opposed to ranges) aren't that thorough, either. test-cutils.c already provides cover for them, but not for ranges. > These sorts of questions may be fine in followup patches. David is doing me a favor with these patches. The tests feel good enough, I don't want to hold these patches hostage to extort more. Reviewed-by: Markus Armbruster <arm...@redhat.com>