96 lines
2.6 KiB
TypeScript
96 lines
2.6 KiB
TypeScript
import { describe, expect, it } from 'bun:test';
|
|
import { solveFirst, solveSecond } from './index.ts';
|
|
|
|
describe('2024-16', () => {
|
|
it('first', () => {
|
|
const testInput = `###############
|
|
#.......#....E#
|
|
#.#.###.#.###.#
|
|
#.....#.#...#.#
|
|
#.###.#####.#.#
|
|
#.#.#.......#.#
|
|
#.#.#####.###.#
|
|
#...........#.#
|
|
###.#.#####.#.#
|
|
#...#.....#.#.#
|
|
#.#.#.###.#.#.#
|
|
#.....#...#.#.#
|
|
#.###.#.#.#.#.#
|
|
#S..#.....#...#
|
|
###############`;
|
|
if (process.env.NODE_ENV === 'production') {
|
|
expect(solveFirst(testInput)).toBe(7036);
|
|
expect(
|
|
solveFirst(`#################
|
|
#...#...#...#..E#
|
|
#.#.#.#.#.#.#.#.#
|
|
#.#.#.#...#...#.#
|
|
#.#.#.#.###.#.#.#
|
|
#...#.#.#.....#.#
|
|
#.#.#.#.#.#####.#
|
|
#.#...#.#.#.....#
|
|
#.#.#####.#.###.#
|
|
#.#.#.......#...#
|
|
#.#.###.#####.###
|
|
#.#.#...#.....#.#
|
|
#.#.#.#####.###.#
|
|
#.#.#.........#.#
|
|
#.#.#.#########.#
|
|
#S#.............#
|
|
#################`)
|
|
).toBe(11048);
|
|
expect(
|
|
solveFirst(`####################################################
|
|
#......................................#..........E#
|
|
#......................................#...........#
|
|
#....................#.................#...........#
|
|
#....................#.................#...........#
|
|
#....................#.................#...........#
|
|
#....................#.................#...........#
|
|
#....................#.................#...........#
|
|
#....................#.................#...........#
|
|
#....................#.................#...........#
|
|
#....................#.................#...........#
|
|
#....................#.............................#
|
|
#S...................#.............................#
|
|
####################################################`)
|
|
).toBe(5078);
|
|
expect(
|
|
solveFirst(`###########################
|
|
#######################..E#
|
|
######################..#.#
|
|
#####################..##.#
|
|
####################..###.#
|
|
###################..##...#
|
|
##################..###.###
|
|
#################..####...#
|
|
################..#######.#
|
|
###############..##.......#
|
|
##############..###.#######
|
|
#############..####.......#
|
|
############..###########.#
|
|
###########..##...........#
|
|
##########..###.###########
|
|
#########..####...........#
|
|
########..###############.#
|
|
#######..##...............#
|
|
######..###.###############
|
|
#####..####...............#
|
|
####..###################.#
|
|
###..##...................#
|
|
##..###.###################
|
|
#..####...................#
|
|
#.#######################.#
|
|
#S........................#
|
|
###########################`)
|
|
).toBe(21148);
|
|
}
|
|
});
|
|
it('second', () => {
|
|
// TODO: add second input
|
|
const testInput = ``;
|
|
// TODO: add second solution
|
|
expect(solveSecond(testInput)).toBe(0);
|
|
});
|
|
});
|