Fix tests
This commit is contained in:
@@ -43,14 +43,16 @@ Deno.test("a texture's .json that doesn't fit its png says why", () => {
|
||||
assertEquals(validate_texture_json({ animation: {} }, size), []);
|
||||
assertEquals(validate_texture_json([], size), ['must be { "animation": { ... } }']);
|
||||
assertEquals(validate_texture_json({ animation: { frametime: 0 } }, size), [
|
||||
"animation.frametime must be a whole number of ticks, at least 1",
|
||||
"animation.frametime must be 1 or more",
|
||||
]);
|
||||
assertEquals(validate_texture_json({ animation: { height: 20 } }, size), [
|
||||
"the png is 16×48, which doesn't split into 16×20 frames",
|
||||
]);
|
||||
assertEquals(validate_texture_json({ animation: { frames: [0, 3, { index: 1 }] } }, size), [
|
||||
"animation.frames[1]: the png has frames 0 to 2",
|
||||
"animation.frames[2]: time must be a whole number of ticks, at least 1",
|
||||
assertEquals(validate_texture_json({ animation: { frames: [0, 3] } }, size), [
|
||||
"animation.frames[1] isn't one of the png's frames, 0 to 2",
|
||||
]);
|
||||
assertEquals(validate_texture_json({ animation: { frames: [{ index: 1 }] } }, size), [
|
||||
"animation.frames[0].time is required",
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -111,7 +113,7 @@ Deno.test("a texture's .json is checked, packed into the .bmod and read back", a
|
||||
"broken.bmod",
|
||||
),
|
||||
Error,
|
||||
"textures/goo.json: animation.frames[0]: the png has frames 0 to 1",
|
||||
"textures/goo.json: animation.frames[0] isn't one of the png's frames, 0 to 1",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user