-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpath-set.js
More file actions
38 lines (35 loc) · 1.14 KB
/
Copy pathpath-set.js
File metadata and controls
38 lines (35 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* global describe, it */
const PathSet = require('../lib/path-set')
const assert = require('assert')
describe('path-set', () => {
it('should have only one entry when adding strings with different cases on win32', () => {
const pathSet = new PathSet()
pathSet._win32 = true
const file = 'foo.js'
pathSet.add(file)
pathSet.add(file.toUpperCase())
assert.strictEqual(pathSet.size, 1)
})
it('should have multiple entries when adding strings with different cases on non-win32', () => {
const pathSet = new PathSet()
pathSet._win32 = false
const file = 'foo.js'
pathSet.add(file)
pathSet.add(file.toUpperCase())
assert.strictEqual(pathSet.size, 2)
})
it('has should return true for different cases on win32', () => {
const pathSet = new PathSet()
pathSet._win32 = true
const file = 'foo.js'
pathSet.add(file)
assert(pathSet.has(file.toUpperCase()))
})
it('has should NOT return true for different cases non-win32', () => {
const pathSet = new PathSet()
pathSet._win32 = false
const file = 'foo.js'
pathSet.add(file)
assert(!pathSet.has(file.toUpperCase()))
})
})