mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-05 20:42:26 +00:00
dependency tree gets populated.
This commit is contained in:
parent
289c154f46
commit
d8a2a9ddac
19 changed files with 229 additions and 707 deletions
28
tst/testJsonParser.Mod
Normal file
28
tst/testJsonParser.Mod
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
MODULE testJsonParser;
|
||||
IMPORT vpkJsonParser, Out;
|
||||
|
||||
VAR
|
||||
jsonRecord: vpkJsonParser.JsonTypePointer;
|
||||
testValue: ARRAY 128 OF CHAR;
|
||||
keyFound: BOOLEAN;
|
||||
|
||||
BEGIN
|
||||
jsonRecord := vpkJsonParser.Create("{'foo': 'bar', 'test': 'test1', 'test2': {'sub': 'dub'}}");
|
||||
|
||||
keyFound := jsonRecord.GetTerminal(jsonRecord, "foo", testValue);
|
||||
|
||||
IF keyFound THEN
|
||||
Out.String('found KEY');
|
||||
Out.String(testValue); Out.Ln;
|
||||
ELSE
|
||||
Out.String('Value for the Key is not found'); Out.Ln;
|
||||
END;
|
||||
keyFound := jsonRecord.GetTerminal(jsonRecord, "test2.sub", testValue);
|
||||
IF keyFound THEN
|
||||
Out.String('found KEY');
|
||||
Out.String(testValue); Out.Ln;
|
||||
ELSE
|
||||
Out.String('Value for the Key is not found'); Out.Ln;
|
||||
END;
|
||||
|
||||
END testJsonParser.
|
||||
Loading…
Add table
Add a link
Reference in a new issue