File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,21 @@ describe('--- Day 14: Chocolate Charts ---', () => {
6161
6262 expect ( expected ) . to . equal ( actual )
6363 } )
64+ it ( 'handles when the score is multidigit' , ( ) => {
65+ const expected = '3710101245158916'
66+
67+ loopRecipesForElves ( recipes , 10 )
68+ // next should be multidigit
69+ loopRecipesForElves ( recipes , 1 )
70+ let actual = recipes . tail . value . toString ( )
71+ let iterator = recipes . tail . next
72+ while ( iterator !== recipes . tail ) {
73+ actual += iterator . value . toString ( )
74+ iterator = iterator . next
75+ }
76+ expect ( recipes . length ) . to . equal ( expected . length )
77+ expect ( expected ) . to . equal ( actual )
78+ } )
6479 } )
6580 describe ( 'calculateXAfterY(x, y, recipe)' , ( ) => {
6681 it ( 'predicts the next X results after the elves have executed Y' , ( ) => {
You can’t perform that action at this time.
0 commit comments