[fpc-pascal] JSON Test Suite

leledumbo leledumbo_cool at yahoo.co.id
Sun Oct 30 14:48:26 CET 2016


> Has anybody tried the FPC JSON parser with these tests?

I just did with the following program:

{$mode objfpc}
uses
  Classes,SysUtils,fpjson,jsonparser;
var
  Input: TStringList;
  JSON: TJSONData;
begin
  try
    try
      Input := TStringList.Create;
      Input.LoadFromFile(ParamStr(1));
      JSON := GetJSON('[""],');
      ExitCode := 0;
    finally
      JSON.Free;
      Input.Free;
    end;
  except
    on e: EParserError do begin
      ExitCode := 1;
    end;
    on e: Exception do begin
      ExitCode := 2;
    end;
  end;
end.

Result is not very convincing:
parsing.html
<http://free-pascal-general.1045716.n5.nabble.com/file/n5726704/parsing.html>  

I test some of the bad cases, indeed fpjson parser is too permissive.



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/JSON-Test-Suite-tp5726702p5726704.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list