|
1 | | -using FluentAssertions; |
| 1 | +using FluentAssertions; |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Globalization; |
4 | 4 | using System.Linq.Dynamic.Core.Parser; |
@@ -152,5 +152,31 @@ public void NumberParser_ParseIntegerLiteral(string text, double expected) |
152 | 152 | // Assert |
153 | 153 | result.Value.Should().Be(expected); |
154 | 154 | } |
| 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 | + } |
155 | 181 | } |
156 | 182 | } |
0 commit comments