Skip to content

Commit

Permalink
test: highlight failing print scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Hyndman committed Nov 30, 2023
1 parent 5f38765 commit c08189f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/binary/print.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { Puzzle, SquareMarkup } from '../../src';
import { printBinaryFile } from '../../src/binary/print';

const MINIMAL_PUZZLE: Puzzle = {
height: 4,
width: 4,
solution: 'ABCDEFGHIJKLMNOP',
clues: ['1A', '1D', '2D', '3D', '4D', '5A', '6A', '7A'],
isScrambled: false,
misc: {
scrambledChecksum: undefined,
},
};

describe('printBinaryFile', () => {
it('prints a simple puzzle', () => {
expect(() => printBinaryFile(MINIMAL_PUZZLE)).not.toThrow();
});

it('prints a puzzle with a sparse markupGrid', () => {
const markupGrid: SquareMarkup[] = [];
markupGrid.length = MINIMAL_PUZZLE.solution.length;
markupGrid[4] = { unknown_08: true };

expect(() => printBinaryFile({ ...MINIMAL_PUZZLE, markupGrid })).not.toThrow();
});
});

0 comments on commit c08189f

Please sign in to comment.