Skip to content

Commit

Permalink
test: add test to verify all timeline syncs are netregex (#6042)
Browse files Browse the repository at this point in the history
Fixes #3547
Closes #5977
cc #5619
  • Loading branch information
quisquous authored Dec 15, 2023
1 parent 9f71f33 commit 8da6e5f
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions test/helper/test_timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ const testTimelineFiles = (timelineFiles: string[]): void => {
assert.isNull(e, `${timelineFile}:${e.error}`);
}
});
it('should use netregex parameter style', () => {
// Incorrect: 8.0 "Crackle Hiss" sync / 1[56]:[^:]*:Imdugud:B55:/
// Correct: 8.0 "Crackle Hiss" Ability { id: "B55", source: "Imdugud" }
for (const sync of timeline.syncStarts) {
assert.strictEqual(sync.regexType, 'net');
}
});
it('should not have translation conflicts', () => {
const translations = triggerSet.timelineReplace;
if (!translations)
Expand Down Expand Up @@ -332,24 +339,6 @@ const testTimelineFiles = (timelineFiles: string[]): void => {
}
}
});
it('should have proper sealed sync', () => {
for (const sync of timeline.syncStarts) {
const regex = sync.regex.source;
if (sync.regexType === 'net')
continue;
if (regex.includes('is no longer sealed')) {
assert.isArray(
/00:0839::\.\*is no longer sealed/.exec(regex),
`${timelineFile}:${sync.lineNumber} 'is no longer sealed' sync must be exactly '00:0839::.*is no longer sealed'`,
);
} else if (regex.includes('will be sealed')) {
assert.isArray(
/00:0839::.*will be sealed/.exec(regex),
`${timelineFile}:${sync.lineNumber} 'will be sealed' sync must be preceded by '00:0839::'`,
);
}
}
});
});
}
});
Expand Down

0 comments on commit 8da6e5f

Please sign in to comment.