web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.2 KiB

  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const assert = require("assert");
  4. const common = require("./common");
  5. describe('Readers → Common', () => {
  6. describe('.joinPathSegments', () => {
  7. it('should return concatenated string', () => {
  8. assert.strictEqual(common.joinPathSegments('.', 'a', '/'), './a');
  9. });
  10. it('should return correct string when the first segment ens with the separator symbol', () => {
  11. // Unix
  12. assert.strictEqual(common.joinPathSegments('/', 'a', '/'), '/a');
  13. assert.strictEqual(common.joinPathSegments('//', 'a', '/'), '//a');
  14. assert.strictEqual(common.joinPathSegments('/a/', 'b', '/'), '/a/b');
  15. // Windows
  16. assert.strictEqual(common.joinPathSegments('C:/', 'Users', '/'), 'C:/Users');
  17. assert.strictEqual(common.joinPathSegments('C:\\', 'Users', '\\'), 'C:\\Users');
  18. assert.strictEqual(common.joinPathSegments('//?/C:/', 'Users', '/'), '//?/C:/Users');
  19. assert.strictEqual(common.joinPathSegments('\\\\?\\C:\\', 'Users', '\\'), '\\\\?\\C:\\Users');
  20. });
  21. });
  22. });