By defining WX_TEST_TEXT_WRAP and WX_TEST_TEXT_WIDTH it's possible to
see how the given text would be wrapped at the given width, which is
useful for testing.
Don't move words to the next line if they just fit into the current one.
This requires checking for the space just at the boundary before looking
for the previous or next space and also using the correct predicate with
lower_bound() which uses inexact comparison.
The existing code behaved completely wrongly whenever a word longer than
the maximal width was present as it just gave up and didn't wrap
anything at all after it -- when it should have just let this word
overflow but still wrap the rest.
Fix this and add a unit test checking that this works correctly now
(several of the tests would have failed before).
Closes#23339.