win32.js 913 B

12345678910111213141516171819202122232425262728293031323334
  1. var test = require('tap').test;
  2. var parents = require('../');
  3. test('win32', function (t) {
  4. var dir = 'c:\\Program Files\\Maxis\\Sim City 2000\\cities';
  5. var dirs = parents(dir, { platform : 'win32' });
  6. t.same(dirs, [
  7. 'c:\\Program Files\\Maxis\\Sim City 2000\\cities',
  8. 'c:\\Program Files\\Maxis\\Sim City 2000',
  9. 'c:\\Program Files\\Maxis',
  10. 'c:\\Program Files',
  11. 'c:',
  12. ]);
  13. t.end();
  14. });
  15. test('win32 c:', function (t) {
  16. var dirs = parents('c:\\', { platform : 'win32' });
  17. t.same(dirs, [ 'c:' ]);
  18. t.end();
  19. });
  20. test('win32 network drive', function (t) {
  21. var dirs = parents(
  22. '\\storageserver01\\Active Projects\\ProjectA',
  23. { platform : 'win32' }
  24. );
  25. t.same(dirs, [
  26. '\\storageserver01\\Active Projects\\ProjectA',
  27. '\\storageserver01\\Active Projects',
  28. '\\storageserver01'
  29. ]);
  30. t.end();
  31. });