Skip to content

Commit a829d23

Browse files
committed
fix: normalize paths in property tests for cross-platform comparison
1 parent 2341b49 commit a829d23

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

tests/property.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import fc from 'fast-check'
1212
import * as fs from 'fs'
1313
import * as path from 'path'
1414
import { globSync as globOriginal, glob as globOriginalAsync } from 'glob'
15-
import { loadGloblin, type GloblinModule } from './harness.js'
15+
import { loadGloblin, type GloblinModule, normalizePath } from './harness.js'
1616
import { createRandomFixture, createLargeFixture } from './fixtures.js'
1717

1818
const fsp = fs.promises
@@ -47,9 +47,12 @@ describe('Property-based tests', () => {
4747
})
4848

4949
function setsEqual(a: Set<string>, b: Set<string>): boolean {
50-
if (a.size !== b.size) return false
51-
for (const item of a) {
52-
if (!b.has(item)) return false
50+
// Normalize paths for cross-platform comparison
51+
const normalizedA = new Set([...a].map(normalizePath))
52+
const normalizedB = new Set([...b].map(normalizePath))
53+
if (normalizedA.size !== normalizedB.size) return false
54+
for (const item of normalizedA) {
55+
if (!normalizedB.has(item)) return false
5356
}
5457
return true
5558
}

0 commit comments

Comments
 (0)