Skip to content

Commit

Permalink
Merge pull request #1323 from AtCoder-NoviSteps/#1321
Browse files Browse the repository at this point in the history
✨ Add gigacode 2019 contest (#1321)
  • Loading branch information
KATO-Hiro authored Sep 28, 2024
2 parents 0609285 + 1568900 commit d3b9aee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/lib/utils/contest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,11 @@ export const classifyContest = (contest_id: string) => {
return ContestType.MATH_AND_ALGORITHM;
}

// HACK: 2024年9月下旬時点では、「Chokudai SpeedRun」と「Donutsプロコンチャレンジ」「COLOCON」のみ該当。
// HACK: 2024年9月下旬時点では、「Chokudai SpeedRun」と「Donutsプロコンチャレンジ」「COLOCON」「GigaCode」のみ該当。
// 対象コンテストが増えた場合は、判定条件を見直す必要がある。
if (
contest_id.startsWith('chokudai_S') ||
contest_id.startsWith('donuts') ||
contest_id.startsWith('colopl')
) {
const prefixes = ['chokudai_S', 'donuts', 'colopl', 'gigacode'];

if (prefixes.some((prefix) => contest_id.startsWith(prefix))) {
return ContestType.OTHERS;
}

Expand Down
6 changes: 4 additions & 2 deletions src/test/lib/utils/contest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,13 @@ describe('Contest', () => {
});
});

describe('when contest_id contains donuts or colopl', () => {
describe('when contest_id contains donuts, colopl and gigacode', () => {
const testCases = [
{ contestId: 'donuts-live2014', expected: ContestType.OTHERS },
{ contestId: 'donuts-2015', expected: ContestType.OTHERS },
{ contestId: 'colopl2018-qual', expected: ContestType.OTHERS },
{ contestId: 'colopl2018-final', expected: ContestType.OTHERS },
{ contestId: 'gigacode-2019', expected: ContestType.OTHERS },
];

runTests('classifyContest', testCases, ({ contestId, expected }: TestCaseForContestType) => {
Expand Down Expand Up @@ -360,12 +361,13 @@ describe('Contest', () => {
);
});

describe('when contest_id contains donuts or colopl', () => {
describe('when contest_id contains donuts, colopl and gigacode', () => {
const testCases = [
{ contestId: 'donuts-live2014', expected: ContestType.OTHERS },
{ contestId: 'donuts-2015', expected: ContestType.OTHERS },
{ contestId: 'colopl2018-qual', expected: ContestType.OTHERS },
{ contestId: 'colopl2018-final', expected: ContestType.OTHERS },
{ contestId: 'gigacode-2019', expected: ContestType.OTHERS },
];

runTests(
Expand Down

0 comments on commit d3b9aee

Please sign in to comment.