SelfTest checks for out_of_range exception coming from Tbc::Text

This commit is contained in:
Mickey Rose 2016-02-21 15:04:06 +01:00
parent 3b4edd7a48
commit 1501339438

View File

@ -300,7 +300,13 @@ TEST_CASE( "Long strings can be wrapped", "[wrap]" ) {
== "one two three\n four\n five\n six" ); == "one two three\n four\n five\n six" );
} }
SECTION( "Wrapping near tab doesn't extract substrings from invalid positions", "" ) {
CHECK_NOTHROW( Text( "one\ttwo", TextAttributes().setWidth( 2 ) ).toString() );
CHECK_NOTHROW( Text( "one\ttwo", TextAttributes().setWidth( 3 ) ).toString() );
CHECK_NOTHROW( Text( "one\ttwo", TextAttributes().setWidth( 4 ) ).toString() );
CHECK_NOTHROW( Text( "one\ttwo", TextAttributes().setWidth( 5 ) ).toString() );
}
} }
using namespace Catch; using namespace Catch;