Skip to content

Commit 11bf0c7

Browse files
committed
Merge remote-tracking branch 'origin/feature/declarative-rlp' into feature/declarative-rlp
# Conflicts: # src/Nethermind/Nethermind.Serialization.FluentRlp/Rlp.cs
2 parents b2e5951 + 1c8f472 commit 11bf0c7

File tree

1 file changed

+32
-0
lines changed
  • src/Nethermind/Nethermind.Serialization.FluentRlp.Test

1 file changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
2+
// SPDX-License-Identifier: LGPL-3.0-only
3+
4+
using FluentAssertions;
5+
using FluentAssertions.Collections;
6+
7+
namespace Nethermind.Serialization.FluentRlp.Test;
8+
9+
// NOTE: `FluentAssertions` currently does not support `(ReadOnly)Span<T>` or `(ReadOnly)Memory<T>` assertions.
10+
public static class Extensions
11+
{
12+
public static GenericCollectionAssertions<T> Should<T>(this ReadOnlySpan<T> span) => span.ToArray().Should();
13+
public static GenericCollectionAssertions<T> Should<T>(this ReadOnlyMemory<T> memory) => memory.ToArray().Should();
14+
15+
public static AndConstraint<GenericCollectionAssertions<TExpectation>> BeEquivalentTo<TExpectation>(
16+
this GenericCollectionAssertions<TExpectation> @this,
17+
ReadOnlySpan<TExpectation> expectation,
18+
string because = "",
19+
params object[] becauseArgs)
20+
{
21+
return @this.BeEquivalentTo(expectation.ToArray(), config => config, because, becauseArgs);
22+
}
23+
24+
public static AndConstraint<GenericCollectionAssertions<TExpectation>> BeEquivalentTo<TExpectation>(
25+
this GenericCollectionAssertions<TExpectation> @this,
26+
ReadOnlyMemory<TExpectation> expectation,
27+
string because = "",
28+
params object[] becauseArgs)
29+
{
30+
return @this.BeEquivalentTo(expectation.ToArray(), config => config, because, becauseArgs);
31+
}
32+
}

0 commit comments

Comments
 (0)