> I've included most of your tests;
I think the best way to test this, is to create these strings from joining @expected arrays.
By generating these arrays one can make sure to cover all edge cases.
As a side product you'll define a formal grammar. Like:
- how are unpaired quotes to be handled?
- what about multiple whitespaces in a row?
- what about multi-line input?
- what about whitespace at start and end of string?
Crafting the strings by hand is error prone, because there are far too many cases to handle.
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|Replies are listed 'Best First'.|
Re^3: solution wanted for break-on-spaces (w/specifics)
by perl-diddler (Chaplain) on Oct 26, 2021 at 16:56 UTC
by LanX (Sage) on Oct 26, 2021 at 21:27 UTC