Skip to content

Commit efa7995

Browse files
committed
Merge branch 'feature/79-fix-failing-tests' into develop
Closes #79
2 parents 4733e39 + 6fead6b commit efa7995

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Src/UStrUtils.pas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ function StrSplit(const Str: UnicodeString; const Delim: UnicodeString;
228228
/// offsets each line using spaces to form a left margin of size given by
229229
/// Margin.</summary>
230230
/// <remarks>Output lines are separated by CRLF.</remarks>
231-
function StrWrap(const Str: UnicodeString; const MaxLen, Margin: Integer):
231+
function StrWrap(const Str: UnicodeString; const MaxLen, Margin: UInt16):
232232
UnicodeString; overload;
233233

234234
/// <summary>Word wraps each paragraph of text in Paras so that each line of a
235235
/// paragraph has lines of maximum length MaxLineLen and is offset by the
236236
/// number of spaces gvien by Margin. Blanks lines are used to separate
237237
/// output paragraphs iff SeparateParas is true.</summary>
238238
/// <remarks>Output lines are separated by CRLF.</remarks>
239-
function StrWrap(const Paras: TStrings; const MaxLineLen, Margin: Integer;
239+
function StrWrap(const Paras: TStrings; const MaxLineLen, Margin: UInt16;
240240
const SeparateParas: Boolean): UnicodeString; overload;
241241

242242
/// <summary>Checks in string Str forms a valid sentence and, if not, adds a
@@ -773,7 +773,7 @@ function StrWindowsLineBreaks(const Str: UnicodeString): UnicodeString;
773773
Result := StrReplace(Result, LF, CRLF);
774774
end;
775775

776-
function StrWrap(const Str: UnicodeString; const MaxLen, Margin: Integer):
776+
function StrWrap(const Str: UnicodeString; const MaxLen, Margin: UInt16):
777777
UnicodeString;
778778
var
779779
Word: UnicodeString; // next word in input Str
@@ -823,7 +823,7 @@ function StrWrap(const Str: UnicodeString; const MaxLen, Margin: Integer):
823823
end;
824824
end;
825825

826-
function StrWrap(const Paras: TStrings; const MaxLineLen, Margin: Integer;
826+
function StrWrap(const Paras: TStrings; const MaxLineLen, Margin: UInt16;
827827
const SeparateParas: Boolean): UnicodeString; overload;
828828
var
829829
Para: string;

Tests/Src/DUnit/TestUStrUtils.pas

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,10 +1069,8 @@ procedure TTestStrUtilsRoutines.TestStrWrap_overload1;
10691069
CheckEquals(ResA, StrWrap(Text, 10, 0), 'Test 5');
10701070
CheckEquals(ResB, StrWrap(Text, 10, 2), 'Test 6');
10711071
CheckEquals(ResC, StrWrap(Text, 15, 0), 'Test 7');
1072-
CheckEquals(ResC, StrWrap(Text, 15, -2), 'Test 8');
1073-
CheckEquals(ResD, StrWrap(Text, 1, 0), 'Test 9');
1074-
CheckEquals(ResD, StrWrap(Text, 0, 0), 'Test 10');
1075-
CheckEquals(ResD, StrWrap(Text, -1, 0), 'Test 11');
1072+
CheckEquals(ResD, StrWrap(Text, 1, 0), 'Test 8');
1073+
CheckEquals(ResD, StrWrap(Text, 0, 0), 'Test 9');
10761074
end;
10771075

10781076
procedure TTestStrUtilsRoutines.TestStrWrap_overload2;

0 commit comments

Comments
 (0)