-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: highlight failing print scenario
- Loading branch information
Andrew Hyndman
committed
Nov 30, 2023
1 parent
5f38765
commit c08189f
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |