File: test.js

package info (click to toggle)
node-slash 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 104 kB
  • ctags: 3
  • sloc: makefile: 2; sh: 2
file content (20 lines) | stat: -rw-r--r-- 588 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';
var assert = require('assert');
var slash = require('./');

describe('slash()', function () {
	it('should convert backwards-slash paths to forward slash paths', function () {
		assert.equal(slash('c:/aaaa\\bbbb'), 'c:/aaaa/bbbb');
		assert.equal(slash('c:\\aaaa\\bbbb'), 'c:/aaaa/bbbb');
	});

	it('should not convert extended-length paths', function () {
		var path = '\\\\?\\c:\\aaaa\\bbbb';
		assert.equal(slash(path), path);
	});

	it('should not convert paths with Unicode', function () {
		var path = 'c:\\aaaa\\bbbb\\★';
		assert.equal(slash(path), path);
	});
});