Skip to content

Commit

Permalink
ubuntu issues 2
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Jan 10, 2025
1 parent 963c449 commit b9f79c9
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions test/filepaths/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,37 @@ describe('Check Builder paths with defailt options', () => {
it('Relative coreDirName linux', () => {
const b = new Builder({}, 'test/dir');

expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('test/dir/dist'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('test/dir/meta'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('test/dir/build.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('test/dir/dist');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('test/dir/meta');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('test/dir/build.log');
});

it('Relative coreDirName windows', () => {
const b = new Builder({}, 'test\\dir');

//expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('test/dir/dist'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('test/dir/meta'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('test/dir/build.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('test/dir/dist');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('test/dir/meta');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('test/dir/build.log');
});

it('Absolute coreDirName linux', () => {
const b = new Builder({}, '/test/dir');

expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('/test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('/test/dir/dist'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('/test/dir/meta'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('/test/dir/build.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('/test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('/test/dir/dist');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('/test/dir/meta');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('/test/dir/build.log');
});

it('Absolute coreDirName windows', () => {
const b = new Builder({}, 'C:\\test\\dir');

//expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('C:/test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('C:/test/dir/dist'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('C:/test/dir/meta'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('C:/test/dir/build.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('C:/test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('C:/test/dir/dist');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('C:/test/dir/meta');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('C:/test/dir/build.log');
});
});

Expand All @@ -66,83 +66,83 @@ describe('Check Builder paths with relative dist dir', () => {
it('Relative coreDirName linux', () => {
const b = new Builder({options: {distDir: 'dist2', metaDir: 'meta2', logPath: 'build2.log'}}, 'test/dir');

expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('test/dir/dist2'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('test/dir/meta2'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('test/dir/build2.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('test/dir/dist2');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('test/dir/meta2');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('test/dir/build2.log');
});

it('Relative coreDirName windows', () => {
const b = new Builder({options: {distDir: 'dist2', metaDir: 'meta2', logPath: 'build2.log'}}, 'test\\dir');

//expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('test/dir/dist2'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('test/dir/meta2'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('test/dir/build2.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('test/dir/dist2');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('test/dir/meta2');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('test/dir/build2.log');
});

it('Absolute coreDirName linux', () => {
const b = new Builder({options: {distDir: 'dist2', metaDir: 'meta2', logPath: 'build2.log'}}, '/test/dir');

expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('/test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('/test/dir/dist2'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('/test/dir/meta2'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('/test/dir/build2.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('/test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('/test/dir/dist2');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('/test/dir/meta2');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('/test/dir/build2.log');
});

it('Absolute coreDirName windows', () => {
const b = new Builder({options: {distDir: 'dist2', metaDir: 'meta2', logPath: 'build2.log'}}, 'C:\\test\\dir');

//expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('C:/test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('C:/test/dir/dist2'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('C:/test/dir/meta2'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('C:/test/dir/build2.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('C:/test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('C:/test/dir/dist2');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('C:/test/dir/meta2');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('C:/test/dir/build2.log');
});
});

describe('Check Builder paths with absolute dist dir', () => {
it('Empty coreDirName', () => {
const b = new Builder({options: {distDir: '/some/dir/dist2', metaDir: '/some/dir/meta2', logPath: '/some/dir/build2.log'}});
const b = new Builder({options: {distDir: '/dist2', metaDir: '/meta2', logPath: '/build2.log'}});

expect(b._coreDirname).to.be.equal('.');
expect(b._distDirname).to.be.equal('/some/dir/dist2');
expect(b._metaDirname).to.be.equal('/some/dir/meta2');
expect(b._logPath).to.be.equal('/some/dir/build2.log');
expect(b._distDirname).to.be.equal('/dist2');
expect(b._metaDirname).to.be.equal('/meta2');
expect(b._logPath).to.be.equal('/build2.log');
});

it('Relative coreDirName linux', () => {
const b = new Builder({options: {distDir: '/some/dir/dist2', metaDir: '/some/dir/meta2', logPath: '/some/dir/build2.log'}}, 'test/dir');
const b = new Builder({options: {distDir: '/dist2', metaDir: '/meta2', logPath: '/build2.log'}}, 'test/dir');

expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('/some/dir/dist2'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('/some/dir/meta2'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('/some/dir/build2.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('/dist2');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('/meta2');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('/build2.log');
});

it('Relative coreDirName windows', () => {
const b = new Builder({options: {distDir: '/some/dir/dist2', metaDir: '/some/dir/meta2', logPath: '/some/dir/build2.log'}}, 'test\\dir');
const b = new Builder({options: {distDir: '/dist2', metaDir: '/meta2', logPath: '/build2.log'}}, 'test\\dir');

//expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('/some/dir/dist2'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('/some/dir/meta2'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('/some/dir/build2.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('/dist2');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('/meta2');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('/build2.log');
});

it('Absolute coreDirName linux', () => {
const b = new Builder({options: {distDir: '/some/dir/dist2', metaDir: '/some/dir/meta2', logPath: '/some/dir/build2.log'}}, '/test/dir');
const b = new Builder({options: {distDir: '/dist2', metaDir: '/meta2', logPath: '/build2.log'}}, '/test/dir');

expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('/test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('/some/dir/dist2'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('/some/dir/meta2'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('/some/dir/build2.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('/test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('/dist2');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('/meta2');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('/build2.log');
});

it('Absolute coreDirName windows', () => {
const b = new Builder({options: {distDir: '/some/dir/dist2', metaDir: '/some/dir/meta2', logPath: '/some/dir/build2.log'}}, 'C:\\test\\dir');
const b = new Builder({options: {distDir: '/dist2', metaDir: '/meta2', logPath: '/build2.log'}}, 'C:\\test\\dir');

//expect(path.normalize(b._coreDirname)).to.be.equal(path.normalize('C:/test/dir'));
expect(path.normalize(b._distDirname)).to.be.equal(path.normalize('/some/dir/dist2'));
expect(path.normalize(b._metaDirname)).to.be.equal(path.normalize('/some/dir/meta2'));
expect(path.normalize(b._logPath)).to.be.equal(path.normalize('/some/dir/build2.log'));
expect(b._coreDirname.replaceAll('\\', '/')).to.be.equal('C:/test/dir');
expect(b._distDirname.replaceAll('\\', '/')).to.be.equal('/dist2');
expect(b._metaDirname.replaceAll('\\', '/')).to.be.equal('/meta2');
expect(b._logPath.replaceAll('\\', '/')).to.be.equal('/build2.log');
});
});

0 comments on commit b9f79c9

Please sign in to comment.