UNPKG

expeditaet

Version:
33 lines (27 loc) 1.03 kB
import { loadTaskResources } from '@alexaegis/advent-of-code-lib'; import { describe, expect, it } from 'vitest'; import packageJson from '../package.json'; import { p1 } from './p1.js'; describe('2015 - Day 1 - Part One', () => { it('should solve the input', async () => { const resources = await loadTaskResources(packageJson.aoc); expect(p1(resources.input)).toEqual(74); }); it('should be that that both the first examples resolves to 0', () => { expect(p1('(())')).toEqual(0); expect(p1('()()')).toEqual(0); }); it('should be that that both the second and the third examples resolves to 3', () => { expect(p1('(((')).toEqual(3); expect(p1('(()(()(')).toEqual(3); expect(p1('))(((((')).toEqual(3); }); it('should be that that both the fourth examples resolves to -1', () => { expect(p1('())')).toEqual(-1); expect(p1('))(')).toEqual(-1); }); it('should be that that both the fith examples resolves to -3', () => { expect(p1(')))')).toEqual(-3); expect(p1(')())())')).toEqual(-3); }); });