Normalize paths to Gradle User Home when calculating cache keys

Fixes #77
This commit is contained in:
Daz DeBoer 2021-09-27 21:05:17 -06:00
parent cc5cdb7fe0
commit 5a5a5b4387
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
3 changed files with 21 additions and 6 deletions

View file

@ -11,5 +11,11 @@ describe('cacheUtils-utils', () => {
const hash = cacheUtils.hashStrings(['foo', 'bar', 'baz'])
expect(hash).toBe('6df23dc03f9b54cc38a0fc1483df6e21')
})
it('normalized filenames', async () => {
const fileNames = ['/foo/bar/baz.zip', '../boo.html']
const posixHash = cacheUtils.hashFileNames(fileNames)
const windowsHash = cacheUtils.hashFileNames(fileNames)
expect(posixHash).toBe(windowsHash)
})
})
})