@@ -18,15 +18,16 @@ gcafb gcf dcaebfg ecagb gf abcdeg gaef cafbge fdbac fegbdc | fgae cfgab fg bagce
1818describe ( '--- Day 8: Seven Segment Search ---' ,  ( )  =>  { 
1919 describe ( 'Part 1' ,  ( )  =>  { 
2020 describe ( 'descrambleSignal()' ,  ( )  =>  { 
21-  const  testData  =  testSingle . split ( '|' ) [ 0 ] . trim ( ) 
22-  const  {  segmentCodes,  charCodes }  =  descrambleSignal ( testData ) 
23- 
2421 it ( 'takes scambled string of 10 codes and identifies the letters matching each seven-digit-display segment' ,  ( )  =>  { 
22+  const  testData  =  testSingle . split ( '|' ) [ 0 ] . trim ( ) 
23+  const  {  segmentCodes }  =  descrambleSignal ( testData ) 
2524 expect ( segmentCodes . length ) . to . equal ( 7 ) 
2625 expect ( segmentCodes . filter ( ( code )  =>  ! [ 'a' ,  'b' ,  'c' ,  'd' ,  'e' ,  'f' ,  'g' ] . includes ( code ) ) . length ) . to . equal ( 0 ) 
2726 } ) 
2827
2928 it ( 'produces a list of character codes for each number that can be displayed' ,  ( )  =>  { 
29+  const  testData  =  testSingle . split ( '|' ) [ 0 ] . trim ( ) 
30+  const  {  charCodes }  =  descrambleSignal ( testData ) 
3031 // There should be exactly 10 numbers 
3132 expect ( charCodes . length ) . to . equal ( 10 ) 
3233 // lengths of each code is predictable as each number has a specific count of segments 
@@ -35,10 +36,9 @@ describe('--- Day 8: Seven Segment Search ---', () => {
3536 } ) 
3637 } ) 
3738 describe ( 'decodeSignal()' ,  ( )  =>  { 
38-  const  testData  =  testMultiple [ 0 ] . split ( '|' ) . map ( ( a )  =>  a . trim ( ) ) 
39-  const  {  charCodes }  =  descrambleSignal ( testData [ 0 ] ) 
40- 
4139 it ( 'decodes a display pattern using the provided map of display codes' ,  ( )  =>  { 
40+  const  testData  =  testMultiple [ 0 ] . split ( '|' ) . map ( ( a )  =>  a . trim ( ) ) 
41+  const  {  charCodes }  =  descrambleSignal ( testData [ 0 ] ) 
4242 const  result  =  decodeSignal ( charCodes ,  testData [ 1 ] ) 
4343 expect ( result [ 0 ] ) . to . equal ( 8 ) 
4444 expect ( result [ 3 ] ) . to . equal ( 4 ) 
0 commit comments