mimicry/test/module.js

32 lines
899 B
JavaScript

"use strict";
mimicry.module([
"terminalModule",
"simple", Mimicry.Type.json,
"background", Mimicry.Type.css,
"text", Mimicry.Type.text,
"binary", Mimicry.Type.binary
], function (global, [terminalModule, simple, background, text, binary]) {
let bnr = false;
if (binary instanceof ArrayBuffer) {
const view = new Uint8Array(binary);
if (
view.length === 32 &&
view[0] === 0 &&
view[1] === 1 &&
view[3] === 3 &&
view[31] === 0x11 &&
view[30] === 0x10 &&
view[10] === 0x6e &&
view[12] === 0x72 &&
view[21] === 0x74
) {
bnr = true;
}
}
return [
terminalModule === "terminal",
simple.a[4] === 115,
text === "Lorem ipsum, I guess",
bnr
];
});