just some little testing of json loading

This commit is contained in:
Blue 2023-09-10 13:39:53 -03:00
parent 9b04a90b53
commit edc489ab1a
Signed by: blue
GPG key ID: 9B203B252A63EE38
5 changed files with 39 additions and 8 deletions

View file

@ -33,6 +33,13 @@ function test () {
log("Value returned from additional module is correct");
else
log("Value returned from additional module is \"" + module + "\", which is incorrect");
const json = mimicry.getAsset("simple");
if (json instanceof Object && json.I === "am")
log("loaded by one of the modules asset (json) is present and valid");
else
log("loaded by one of the modules asset (json) is not present or invalid");
});
log("Successfully launched Mimicry empty module");
} catch (e) {

View file

@ -28,6 +28,12 @@ function test () {
log("Value returned from additional module is correct");
else
log("Value returned from additional module is \"" + module + "\", which is incorrect");
const json = mimicry.getAsset("simple");
if (json instanceof Object && json.I === "am")
log("loaded by one of the modules asset (json) is present and valid");
else
log("loaded by one of the modules asset (json) is not present or invalid");
});
log("Successfully launched Mimicry empty module");
} catch (e) {

View file

@ -1,7 +1,8 @@
"use strict";
mimicry.module([
"terminalModule",
"simple", Mimicry.Type.json,
"background", Mimicry.Type.css
], function (global, [terminalModule]) {
return terminalModule === "terminal";
], function (global, [terminalModule, simple]) {
return terminalModule === "terminal" && simple.a[4] === 115;
});

10
test/simple.json Normal file
View file

@ -0,0 +1,10 @@
{
"I": "am",
"a": [
"simple",
true,
true,
"json",
115
]
}