Compare commits
1 Commits
developmen
...
bugfix/ZEN
Author | SHA1 | Date |
---|---|---|
Jeremy Desanlis | 72c77c5561 |
|
@ -25,6 +25,7 @@ class DelimiterMaster extends Delimiter {
|
||||||
// non-PHD master version or a version whose master is a PHD version
|
// non-PHD master version or a version whose master is a PHD version
|
||||||
this.prvKey = undefined;
|
this.prvKey = undefined;
|
||||||
this.prvPHDKey = undefined;
|
this.prvPHDKey = undefined;
|
||||||
|
this.markerParams = parameters.marker;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,7 +117,7 @@ class DelimiterMaster extends Delimiter {
|
||||||
}
|
}
|
||||||
|
|
||||||
skipping() {
|
skipping() {
|
||||||
if (this.NextMarker) {
|
if (this.NextMarker && this.NextMarker !== this.markerParams) {
|
||||||
// next marker:
|
// next marker:
|
||||||
// - foo/ : skipping foo/
|
// - foo/ : skipping foo/
|
||||||
// - foo : skipping foo.
|
// - foo : skipping foo.
|
||||||
|
|
|
@ -36,13 +36,25 @@ describe('Delimiter All masters listing algorithm', () => {
|
||||||
assert.strictEqual(delimiter.skipping(), SKIP_NONE);
|
assert.strictEqual(delimiter.skipping(), SKIP_NONE);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return SKIP_NONE for DelimiterMaster when NextMarker is ' +
|
||||||
|
'set to listing marker parameter value', () => {
|
||||||
|
const markerParams = 'marker';
|
||||||
|
const delimiter = new DelimiterMaster({
|
||||||
|
delimiter: '/',
|
||||||
|
marker: markerParams,
|
||||||
|
});
|
||||||
|
|
||||||
|
/* When there is no NextMarker, it should return SKIP_NONE. */
|
||||||
|
delimiter.NextMarker = markerParams;
|
||||||
|
assert.strictEqual(delimiter.skipping(), SKIP_NONE);
|
||||||
|
});
|
||||||
|
|
||||||
it('should return <key><VersionIdSeparator> for DelimiterMaster when ' +
|
it('should return <key><VersionIdSeparator> for DelimiterMaster when ' +
|
||||||
'NextMarker is set and there is a delimiter', () => {
|
'NextMarker is set and there is a delimiter', () => {
|
||||||
const key = 'key';
|
const key = 'key';
|
||||||
const delimiter = new DelimiterMaster({ delimiter: '/', marker: key });
|
const delimiter = new DelimiterMaster({ delimiter: '/' });
|
||||||
|
|
||||||
/* Filter a master version to set NextMarker. */
|
/* Filter a master version to set NextMarker. */
|
||||||
// TODO: useless once S3C-1628 is fixed.
|
|
||||||
delimiter.filter({ key, value: '' });
|
delimiter.filter({ key, value: '' });
|
||||||
assert.strictEqual(delimiter.NextMarker, key);
|
assert.strictEqual(delimiter.NextMarker, key);
|
||||||
|
|
||||||
|
@ -58,12 +70,14 @@ describe('Delimiter All masters listing algorithm', () => {
|
||||||
const keyWithEndingDelimiter = `key${delimiterChar}`;
|
const keyWithEndingDelimiter = `key${delimiterChar}`;
|
||||||
const delimiter = new DelimiterMaster({
|
const delimiter = new DelimiterMaster({
|
||||||
delimiter: delimiterChar,
|
delimiter: delimiterChar,
|
||||||
marker: keyWithEndingDelimiter,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Filter a master version to set NextMarker. */
|
||||||
|
delimiter.filter({ key: keyWithEndingDelimiter, value: '' });
|
||||||
|
assert.strictEqual(delimiter.NextMarker, keyWithEndingDelimiter);
|
||||||
|
|
||||||
/* When a delimiter is set and the NextMarker ends with the
|
/* When a delimiter is set and the NextMarker ends with the
|
||||||
* delimiter it should return the next marker value. */
|
* delimiter it should return the next marker value. */
|
||||||
assert.strictEqual(delimiter.NextMarker, keyWithEndingDelimiter);
|
|
||||||
assert.strictEqual(delimiter.skipping(), keyWithEndingDelimiter);
|
assert.strictEqual(delimiter.skipping(), keyWithEndingDelimiter);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue