mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-26 12:29:36 +02:00
fcl-json: fixed writing boolean lowercase, as expected by reader
git-svn-id: trunk@47040 -
This commit is contained in:
parent
18f5fab782
commit
65bcfe36b3
@ -1796,7 +1796,7 @@ end;
|
||||
|
||||
function TJSONBoolean.GetAsString: TJSONStringType;
|
||||
begin
|
||||
Result:=BoolToStr(FValue, True);
|
||||
Result:=BoolToStr(FValue, 'true', 'false');
|
||||
end;
|
||||
|
||||
procedure TJSONBoolean.SetAsString(const AValue: TJSONStringType);
|
||||
|
@ -19,7 +19,7 @@ unit testjsondata;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testregistry, fpjson, contnrs;
|
||||
Classes, SysUtils, fpcunit, testregistry, fpjson;
|
||||
|
||||
type
|
||||
TMyNull = Class(TJSONNull);
|
||||
@ -1311,7 +1311,7 @@ begin
|
||||
TestAsInteger(J,1);
|
||||
TestAsInt64(J,1);
|
||||
TestAsQword(J,1);
|
||||
TestAsString(J,BoolToStr(True,True));
|
||||
TestAsString(J,BoolToStr(True,'true','false'));
|
||||
TestAsFloat(J,1.0);
|
||||
finally
|
||||
FreeAndNil(J);
|
||||
@ -1334,7 +1334,7 @@ begin
|
||||
TestAsInteger(J,0);
|
||||
TestAsInt64(J,0);
|
||||
TestAsQWord(J,0);
|
||||
TestAsString(J,BoolToStr(False,True));
|
||||
TestAsString(J,BoolToStr(False,'true','false'));
|
||||
TestAsFloat(J,0.0);
|
||||
finally
|
||||
FreeAndNil(J);
|
||||
|
Loading…
Reference in New Issue
Block a user