Skip to content

Commit a317a58

Browse files
committed
2.5.4
1 parent c4bb82c commit a317a58

File tree

6 files changed

+234
-235
lines changed

6 files changed

+234
-235
lines changed

CHANGELOG.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# 2.5.4 (TBD)
2-
- Fix String.Split to correctly handle multi-character separators (e.g., `"<br />"` now splits on the whole string instead of each character) [bug]
3-
- Add String.First helper to get the first element from an array/collection [enhancement]
4-
- Add String.Last helper to get the last element from an array/collection [enhancement]
1+
# 2.5.4 (21 December 2025)
2+
- [#135](https://github.com/Handlebars-Net/Handlebars.Net.Helpers/pull/135) - Add String.First/Last helpers and fix Split for multi-char separators [enhancement] contributed by [ablyler](https://github.com/ablyler)
3+
- [#130](https://github.com/Handlebars-Net/Handlebars.Net.Helpers/issues/130) - Conflict Between Truncate Helpers Prevents Usage Without Prefix [bug]
54

65
# 2.5.3 (13 September 2025)
76
- [#132](https://github.com/Handlebars-Net/Handlebars.Net.Helpers/pull/132) - Humanizer Truncate should always be used as &quot;Humanizer.Truncate&quot; [bug] contributed by [StefH](https://github.com/StefH)

Generate-ReleaseNotes.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
rem https://github.com/StefH/GitHubReleaseNotes
22

3-
SET version=2.5.3
3+
SET version=2.5.4
44

55
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels question invalid documentation duplicate --version %version% --token %GH_TOKEN%

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<PropertyGroup>
77
<TargetFrameworks>net451;net452;net46;netstandard1.3;netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
8-
<VersionPrefix>2.5.3</VersionPrefix>
8+
<VersionPrefix>2.5.4</VersionPrefix>
99
<LangVersion>12</LangVersion>
1010
<Nullable>enable</Nullable>
1111
<Copyright>Copyright © 2020-2025 Stef Heyenrath</Copyright>

test/Handlebars.Net.Helpers.Tests/Handlebars.Net.Helpers.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
</PackageReference>
21-
<PackageReference Include="CultureAwareTesting.xUnit" Version="0.0.1" />
21+
<PackageReference Include="CultureAwareTesting.xUnit" Version="0.0.1.1" />
2222
<PackageReference Include="FluentAssertions" Version="5.10.3" />
2323
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
2424
<PackageReference Include="Moq" Version="4.17.2" />

test/Handlebars.Net.Helpers.Tests/Helpers/StringHelpersTests.cs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,42 @@ public void Ellipsis(string value, int length, string expected)
127127
result.Should().Be(expected);
128128
}
129129

130+
[Fact]
131+
public void First_ReturnsFirstElement()
132+
{
133+
// Arrange
134+
var values = new object[] { "first", "second", "third" };
135+
136+
// Act
137+
var result = _sut.First(values);
138+
139+
// Assert
140+
result.Should().Be("first");
141+
}
142+
143+
[Fact]
144+
public void First_ReturnsNullForEmptyCollection()
145+
{
146+
// Arrange
147+
var values = new object[0];
148+
149+
// Act
150+
var result = _sut.First(values);
151+
152+
// Assert
153+
result.Should().BeNull();
154+
}
155+
156+
[Fact]
157+
public void First_ThrowsForNullCollection()
158+
{
159+
// Act
160+
Action action = () => _sut.First(null!);
161+
162+
// Assert
163+
action.Should().Throw<ArgumentNullException>();
164+
}
165+
130166
[Theory]
131167
[InlineData("Hello &amp; World", "Hello & World")]
132168
[InlineData("1 &lt; 2 &gt; 0", "1 < 2 > 0")]
@@ -613,42 +649,6 @@ public void Split(string value, string separator, string[] expected)
613649
result.Should().BeEquivalentTo(expected);
614650
}
615651

616-
[Fact]
617-
public void First_ReturnsFirstElement()
618-
{
619-
// Arrange
620-
var values = new object[] { "first", "second", "third" };
621-
622-
// Act
623-
var result = _sut.First(values);
624-
625-
// Assert
626-
result.Should().Be("first");
627-
}
628-
629-
[Fact]
630-
public void First_ReturnsNullForEmptyCollection()
631-
{
632-
// Arrange
633-
var values = Array.Empty<object>();
634-
635-
// Act
636-
var result = _sut.First(values);
637-
638-
// Assert
639-
result.Should().BeNull();
640-
}
641-
642-
[Fact]
643-
public void First_ThrowsForNullCollection()
644-
{
645-
// Act
646-
Action action = () => _sut.First(null!);
647-
648-
// Assert
649-
action.Should().Throw<ArgumentNullException>();
650-
}
651-
652652
[Fact]
653653
public void Last_ReturnsLastElement()
654654
{
@@ -666,7 +666,7 @@ public void Last_ReturnsLastElement()
666666
public void Last_ReturnsNullForEmptyCollection()
667667
{
668668
// Arrange
669-
var values = Array.Empty<object>();
669+
var values = new object[0];
670670

671671
// Act
672672
var result = _sut.Last(values);

0 commit comments

Comments
 (0)