dependency tree gets populated.

This commit is contained in:
Norayr Chilingarian 2020-06-09 17:57:59 +04:00
parent 289c154f46
commit d8a2a9ddac
19 changed files with 229 additions and 707 deletions

43
tst/testFiles.Mod Normal file
View file

@ -0,0 +1,43 @@
MODULE testFiles;
IMPORT Out, vpkFiles;
VAR
f : vpkFiles.fileInfo;
PROCEDURE test(f: vpkFiles.fileInfo);
VAR
b : BOOLEAN;
BEGIN
Out.String(f.name); Out.Ln;
IF vpkFiles.Exists(f) THEN
Out.String("exists"); Out.Ln;
IF vpkFiles.dir IN f.attr THEN Out.String("directory"); Out.Ln; END;
IF vpkFiles.char IN f.attr THEN Out.String("char"); Out.Ln; END;
IF vpkFiles.block IN f.attr THEN Out.String("block"); Out.Ln; END;
IF vpkFiles.file IN f.attr THEN Out.String("file"); Out.Ln; END;
IF vpkFiles.fifo IN f.attr THEN Out.String("fifo"); Out.Ln; END;
IF vpkFiles.symlink IN f.attr THEN Out.String("symlink"); Out.Ln; END;
IF vpkFiles.socket IN f.attr THEN Out.String("socket"); Out.Ln; END;
ELSE
Out.String("does not exist"); Out.Ln;
END;
Out.Ln;
END test;
BEGIN
f.name := "/aosenth";
test(f);
f.name := "/dev/nvme0n1";
test(f);
f.name := "/home";
test(f);
f.name := "/etc/fstab";
test(f);
f.name := "/usr/src/linux";
test(f);
f.name := "/dev/video0";
test(f);
f.name := "/tmp/fifo";
test(f);
END testFiles.

28
tst/testJsonParser.Mod Normal file
View 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.