@@ -64,7 +64,8 @@ TTestStrUtilsRoutines = class(TTestCase)
64
64
procedure TestStrJoin ;
65
65
procedure TestStrExplode ;
66
66
procedure TestStrSplit ;
67
- procedure TestStrWrap_overload1 ;
67
+ procedure TestStrWrap_overload1_default_param ;
68
+ procedure TestStrWrap_overload1_no_default_param ;
68
69
procedure TestStrWrap_overload2 ;
69
70
procedure TestStrMakeSentence ;
70
71
procedure TestStrIf ;
@@ -1037,7 +1038,7 @@ procedure TTestStrUtilsRoutines.TestStrWindowsLineBreaks;
1037
1038
CheckEquals(#13 #10 #13 #10 #13 #10 , StrWindowsLineBreaks(#10 #13 #13 #10 ), ' Test 8' );
1038
1039
end ;
1039
1040
1040
- procedure TTestStrUtilsRoutines.TestStrWrap_overload1 ;
1041
+ procedure TTestStrUtilsRoutines.TestStrWrap_overload1_default_param ;
1041
1042
const
1042
1043
Text = ' The quick brown fox jumped-over-the lazy dog.' ;
1043
1044
// 123456789012345678901234567890123456789012345
@@ -1073,6 +1074,42 @@ procedure TTestStrUtilsRoutines.TestStrWrap_overload1;
1073
1074
CheckEquals(ResD, StrWrap(Text, 0 , 0 ), ' Test 9' );
1074
1075
end ;
1075
1076
1077
+ procedure TTestStrUtilsRoutines.TestStrWrap_overload1_no_default_param ;
1078
+ const
1079
+ Text = ' The quick brown fox jumped-over-the lazy dog.' ;
1080
+ // 123456789012345678901234567890123456789012345
1081
+ // 1 2 3 4
1082
+ ResA = ' The quick' + EOL
1083
+ + ' brown fox' + EOL
1084
+ + ' jumped-over-the' + EOL
1085
+ + ' lazy dog.' ;
1086
+ ResB = ' The quick' + EOL
1087
+ + ' brown fox' + EOL
1088
+ + ' jumped-over-the' + EOL
1089
+ + ' lazy dog.' ;
1090
+ ResC = ' The quick' + EOL
1091
+ + ' brown fox' + EOL
1092
+ + ' jumped-over-the' + EOL
1093
+ + ' lazy dog.' ;
1094
+ ResD = ' The quick' + EOL
1095
+ + ' brown fox' + EOL
1096
+ + ' jumped-over-the' + EOL
1097
+ + ' lazy dog.' ;
1098
+
1099
+ begin
1100
+ CheckEquals(' ' , StrWrap(' ' , 12 , 0 , 0 ), ' Test 1a' );
1101
+ CheckEquals(' ' , StrWrap(' ' , 12 , 4 , 2 ), ' Test 1b' );
1102
+ CheckEquals(' ' , StrWrap(' ' , 12 , 4 , -2 ), ' Test 1b' );
1103
+ CheckEquals(' X' , StrWrap(' X' , 12 , 0 ), ' Test 2a' );
1104
+ CheckEquals(' X' , StrWrap(' X' , 12 , 4 , 2 ), ' Test 2b' );
1105
+ CheckEquals(' X' , StrWrap(' X' , 12 , 4 , -2 ), ' Test 2c' );
1106
+ CheckEquals(' X' , StrWrap(' X' , 12 , 4 , -2 ), ' Test 2c' );
1107
+ CheckEquals(ResA, StrWrap(Text, 12 , 0 , 0 ), ' Test 3a' );
1108
+ CheckEquals(ResB, StrWrap(Text, 12 , 2 , 0 ), ' Test 3b' );
1109
+ CheckEquals(ResC, StrWrap(Text, 12 , 2 , 2 ), ' Test 3b' );
1110
+ CheckEquals(ResD, StrWrap(Text, 12 , 4 , -2 ), ' Test 3b' );
1111
+ end ;
1112
+
1076
1113
procedure TTestStrUtilsRoutines.TestStrWrap_overload2 ;
1077
1114
const
1078
1115
Para1 = ' Lorem ipsum dolor sit amet, consectetur adipiscing elit.' ;
0 commit comments