Skip to content

Commit e07bed8

Browse files
committed
UnitTest for issue ahausladen#78
1 parent f29b87d commit e07bed8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

UnitTest/TestJsonDataObjects.pas

+17
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ TestTJsonBaseObject = class(TTestCase)
7373
procedure TestToJsonSerializationConfig;
7474
procedure TestSyntaxErrors;
7575
procedure TestDateTimeToJsonString;
76+
procedure TestSmallFloatValues;
7677
end;
7778

7879
TestTJsonArray = class(TTestCase)
@@ -1748,6 +1749,22 @@ procedure TestTJsonBaseObject.TestToJsonSerializationConfig;
17481749
end;
17491750
end;
17501751

1752+
procedure TestTJsonBaseObject.TestSmallFloatValues;
1753+
var
1754+
Json: TJsonObject;
1755+
S: string;
1756+
begin
1757+
// Test for Issue #78
1758+
Json := TJsonObject.Create;
1759+
try
1760+
Json.F['Value'] := 0.00001;
1761+
S := Json.ToJSON();
1762+
TJsonObject.Parse(S).Free;
1763+
finally
1764+
Json.Free;
1765+
end;
1766+
end;
1767+
17511768
{ TestTJsonArray }
17521769

17531770
procedure TestTJsonArray.SetUp;

0 commit comments

Comments
 (0)