Skip to content

Commit

Permalink
chore(vendor.dreame): Add test case with a ginormous map file from an…
Browse files Browse the repository at this point in the history
… industrial building
  • Loading branch information
Hypfer committed Nov 28, 2023
1 parent b184b75 commit 0d5a7df
Show file tree
Hide file tree
Showing 3 changed files with 50,785 additions and 0 deletions.
24 changes: 24 additions & 0 deletions backend/test/lib/robots/dreame/DreameMapParser_spec.js
Expand Up @@ -386,4 +386,28 @@ describe("DreameMapParser", function () {

actual.should.deepEqual(expected);
});

it("Should pre-process & parse L10S Ultra FW 3031 giant map correctly", async function() {
let data = await fs.readFile(path.join(__dirname, "/res/map/l10su_3031_giant.bin"));
let expected = JSON.parse(await fs.readFile(path.join(__dirname, "/res/map/l10su_3031_giant.json"), { encoding: "utf-8" }));
let actual = await DreameMapParser.PARSE(await DreameMapParser.PREPROCESS(data));

if (actual.metaData?.nonce) {
delete(actual.metaData.nonce);
}

actual.layers.length.should.equal(expected.layers.length, "layerCount");

actual.layers.forEach((layer, i) => {
actual.layers[i].should.deepEqual(expected.layers[i]);
});

actual.entities.length.should.equal(expected.entities.length, "entitiesCount");

actual.entities.forEach((layer, i) => {
actual.entities[i].should.deepEqual(expected.entities[i]);
});

actual.should.deepEqual(expected);
});
});

Large diffs are not rendered by default.

0 comments on commit 0d5a7df

Please sign in to comment.