this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix tests

alice 930be258 ba37f2d7

+6 -3
+6 -3
scripts/generateAirportTzList.test.ts
··· 95 95 96 96 // Expect the three airport codes to be present exactly once each in the code pool section 97 97 ['JFK', 'LHR', 'FEN'].forEach(code => { 98 - const matches = content.match(new RegExp(`"${code}"`, 'g')); 98 + // Codes are encoded as bit-packed entries with comments like /* JFK */ 99 + const matches = content.match(new RegExp(`\\/\\*\\s*${code}\\s*\\*\\/`, 'g')); 99 100 expect(matches).not.toBeNull(); 100 101 expect(matches!.length).toBe(1); 101 102 }); ··· 114 115 await generateCCode(airportsList, out, 5, 5); 115 116 const content = await fs.readFile(out, 'utf-8'); 116 117 117 - // Extract all std_offset_hours occurrences 118 - const stdOffsets = Array.from(content.matchAll(/\{\s+(-?\d+\.\d+)f,/g)).map(m => Number(m[1])); 118 + // Extract quarter-hour std offsets (first field in each TzInfo entry) 119 + const stdOffsetQuarters = Array.from(content.matchAll(/\{\s*([+-]?\d+),/g)).map(m => Number(m[1])); 120 + // Convert to hours by dividing by 4 121 + const stdOffsets = stdOffsetQuarters.map(q => q / 4); 119 122 // Expect three distinct standard offsets: -5, 0, -2 hours 120 123 expect(new Set(stdOffsets)).toEqual(new Set([-5, 0, -2])); 121 124 });