Skip to content

Commit fe14563

Browse files
committed
✅ add test for correct parsing of nested brackets in Decoder
1 parent 591a29d commit fe14563

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

QsNet.Tests/DecodeTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,4 +4765,22 @@ public void Decode_CommaSplit_ThrowsWhenSumExceedsLimitAndThrowOn()
47654765
}
47664766

47674767
#endregion
4768+
4769+
#region Nested brackets
4770+
4771+
[Fact]
4772+
public void NestedBrackets_AreParsedCorrectly()
4773+
{
4774+
Qs.Decode("a[b[]]=c", new DecodeOptions())
4775+
.Should().BeEquivalentTo(
4776+
new Dictionary<string, object?>
4777+
{
4778+
["a"] = new Dictionary<string, object?>
4779+
{
4780+
["b[]"] = "c"
4781+
}
4782+
});
4783+
}
4784+
4785+
#endregion
47684786
}

0 commit comments

Comments
 (0)