package day19

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestPart1(t *testing.T) {
	r := Part1(`r, wr, b, g, bwu, rb, gb, br

brwrr
bggr
gbbr
rrbgbr
ubwu
bwurrg
brgr
bbrgwb`)
	require.Equal(t, 6, r)
}

func TestPart2(t *testing.T) {
	r := Part2(`r, wr, b, g, bwu, rb, gb, br

brwrr
bggr
gbbr
rrbgbr
ubwu
bwurrg
brgr
bbrgwb`)
	require.Equal(t, 16, r)
}

func TestPart2Long(t *testing.T) {
	r := Part2(`rrgwru, gwubwg, wgbbw, bwb, ugrgw, uwgguuw, wuggb, bgwb, ubrr, grruuub, rwbwgbub, wwwggg, uuw, gubuu, urwb, bubg, bubb, rruruuu, ubgr, uw, urugg, wubuu, brwb, buw, bgug, wgbwwrb, rwrgrr, gwgr, rrwrg, wwbwgbw, gguu, rgg, bwg, ruurrwg, wbu, ggg, wrw, brbw, wbb, rrbgg, gbb, gwwrubwu, rwgu, grgwwu, wguu, rwg, wbwug, rbur, gwg, wbrugu, wbwwgu, wbbuw, rwrg, rgru, rgb, bwwrg, bwur, rrubwu, gwb, ugwur, wbguwb, rbu, ubrwgw, ruwbr, wbbu, rrbwbg, rgub, rwgb, urwg, bbw, bugg, rugwg, rwbrwww, wuru, guu, brwbg, ug, ruuwruw, bguww, wwrgrurg, rrbgr, uubwurb, brrrwgg, bur, urg, rbg, wruw, gr, ugb, wwrbgrg, wbuuw, bbugu, uug, rrbb, rrbw, bgr, wwwru, rgu, urr, rg, wbgbru, brrgu, gubu, rurgr, wwbrgg, ruurwgwg, rbb, rbrugwb, gwwrbg, bwuuwrg, wu, b, bgwrb, uwggr, rgbb, rww, wgwb, gwgwr, uwbb, uww, gu, ubwuu, wbwwwug, rurwru, rr, rrg, uggr, bgwu, wbgbu, urggw, br, gubgugr, wgrb, bbgrrbu, brbg, wrg, bgrb, rwbwwur, uwr, bubu, grwb, ubb, wr, bbbgwr, bug, uwgwuwu, grb, bgw, uuu, ugr, wgbbgu, gbg, bgwub, urbgrw, rbruwg, gb, bbwgwur, uwbgwrr, ggrb, wbrrwrbu, gbbugrb, ub, rwb, gwr, ruwu, gurgu, rru, uuwwgwuw, bw, ruwbbb, rbgrgu, wuwu, grrugr, wgr, rbbr, rugr, rrrrbww, bwrr, wrbbr, uuwgr, gug, wwb, rgur, brbrr, gguw, grwubrg, rrrr, uwb, wuwwrrwg, gwbggr, rwrub, wuur, gub, rbgb, urrbubrr, uwubu, brbb, bwbr, bww, ruuubwu, ugbbbr, bub, rrug, wub, gruu, uu, bbu, gbbr, urrg, buwu, grw, grbbbu, bgb, ugubg, uwww, urw, wwubruww, buurb, www, bguurr, wwgu, wgb, ruwub, wggggbg, urrb, gbwuw, ubrrg, wrr, gbubgg, gw, wuw, wuug, wwrb, wgg, rgugrru, rgwrbr, guurrg, bgu, rurgb, gwggb, bwgbbw, ggwb, ubwgw, bbg, rbr, wgru, urwr, brr, rgbr, rgr, wwg, guwuru, uuggg, rrw, buu, urb, guwg, ugwwbuwb, rubb, brbuww, rwugru, ubu, wwub, bgwgb, wrug, rug, w, brgg, wwugwruw, ggrwb, bbwuwuu, uub, rrr, ggbrr, wbur, wurbru, wgu, brb, urbbb, gburbww, wbrgruru, rbugr, gubw, wgwgg, rwr, ugw, gggg, gwrwrg, rrub, gbwgg, grg, uwuur, gbwbbb, guw, gbwbb, uwu, ruw, bwr, rwgub, rbw, ggbwr, u, gwu, rrurrb, gwgg, uugwrbr, brw, ugburg, rwu, wwu, wbr, ruwgr, gbwbur, rwgr, rwbww, rbgr, rgbub, rbbuw, ruu, bwgw, bbwg, ubr, gurr, wwr, wwwguu, gbw, ggw, gru, wug, rubwrbrr, wbrrrr, uru, wbgw, wgur, uurgg, bbb, rbwgwbur, wwbwur, bbgubw, gww, brg, ugu, rgrgw, wwrrgugu, rrrwuww, uwwrb, wrb, rrgg, wubgrrb, bwwgrbww, gbr, gwrwu, brgwwbu, urrwub, rbru, bwrgrr, brwuwrb, guuur, wb, bbrb, brww, wuwrww, bu, rgw, rwbwug, bbug, urrgr, bg, bgg, wbgwbgru, wbrru, uwbbr, wbg, gwwur, gur, ubwb, gubbb, bb, wrugr, grur, rb, uwubrg, bwgrw, gbug, g, wuwubgw, ubw, urgu, rrrg, uwg, bbww, uwgrug, ww, ggu, gwbuwu, rgggwgr, wugw, gbrrg, ugg, bwu, ubuur, uurrw, uwwug, bgww, ubg, rw, gwgbwrg, wuu, rbgbg, buwbur, rub, ugbwwrgu, gbww, wbw, gurbwu, bruw, rggrbrgw, wguwu, ubwbwr, ru, uwur, ggb, uurwg, wguubgr, wru, rbrbr, rbwr, wwwrbb, urww, rur, bru, bbbwrw, uwrwrr, ruww, ububbgr, rrb, bggrwg, bbr, wrwrb, bwgwrbg, grbuwg, gg, ubuurwg, uur, guguwb, rugurgbw, bbuwbb

wrbwgruugbbgwwurggwrgrrrurbgwbgggwbbgwgbrwggwur`)
	require.Equal(t, 16, r)
}
