Skip to content

Commit e8dd351

Browse files
include ParseRealLiteral tests
1 parent 7cfb8a9 commit e8dd351

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

test/System.Linq.Dynamic.Core.Tests/Parser/NumberParserTests.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using FluentAssertions;
1+
using FluentAssertions;
22
using System.Collections.Generic;
33
using System.Globalization;
44
using System.Linq.Dynamic.Core.Parser;
@@ -152,5 +152,31 @@ public void NumberParser_ParseIntegerLiteral(string text, double expected)
152152
// Assert
153153
result.Value.Should().Be(expected);
154154
}
155+
156+
[Theory]
157+
[InlineData("42", 'm', 42)]
158+
[InlineData("-42", 'm', -42)]
159+
[InlineData("42m", 'm', 42)]
160+
[InlineData("-42m", 'm', -42)]
161+
162+
[InlineData("42", 'd', 42)]
163+
[InlineData("-42", 'd', -42)]
164+
[InlineData("42d", 'd', 42)]
165+
[InlineData("-42d", 'd', -42)]
166+
167+
[InlineData("42", 'f', 42)]
168+
[InlineData("-42", 'f', -42)]
169+
[InlineData("42f", 'f', 42)]
170+
[InlineData("-42f", 'f', -42)]
171+
public void NumberParser_ParseRealLiteral(string text, char qualifier, double expected)
172+
{
173+
// Arrange
174+
175+
// Act
176+
var result = new NumberParser(_parsingConfig).ParseRealLiteral(text, qualifier, true) as ConstantExpression;
177+
178+
// Assert
179+
result!.Value.Should().Be(expected);
180+
}
155181
}
156182
}

0 commit comments

Comments
 (0)