Skip to content

Commit 09b6617

Browse files
committed
add tests to LanguageNormalizer.test.ts
1 parent 767ff59 commit 09b6617

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

atcoder-problems-frontend/src/utils/LanguageNormalizer.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,26 @@ test("normalize language", () => {
77
expect(normalizeLanguage("C++11 (Clang++ 3.4)")).toBe("C++");
88
expect(normalizeLanguage("Scala (2.11.7)")).toBe("Scala");
99
expect(normalizeLanguage("Fortran(GNU Fortran 9.2.1)")).toBe("Fortran");
10+
expect(normalizeLanguage("Ada2012 (GNAT 9.2.1)")).toBe("Ada");
11+
expect(normalizeLanguage("Haxe (4.0.3); js")).toBe("Haxe");
12+
expect(normalizeLanguage("C++11 (Clang++ 3.4)")).toBe("C++");
13+
expect(normalizeLanguage("C++ 20 (gcc 12.2)")).toBe("C++");
14+
expect(normalizeLanguage("C# 11.0 (.NET 7.0.7)")).toBe("C#");
15+
expect(normalizeLanguage("C# 11.0 AOT (.NET 7.0.7)")).toBe("C#");
16+
expect(normalizeLanguage("Visual Basic 16.9 (...)")).toBe("Visual Basic");
17+
expect(normalizeLanguage("><> (fishr 0.1.0)")).toBe("><>");
18+
expect(normalizeLanguage("プロデル (...)")).toBe("プロデル");
19+
20+
// mapped individually
21+
expect(normalizeLanguage("Assembly x64")).toBe("Assembly x64");
22+
expect(normalizeLanguage("Awk (GNU Awk 4.1.4)")).toBe("AWK");
23+
expect(normalizeLanguage("IOI-Style C++ (GCC 5.4.1)")).toBe("C++");
24+
expect(normalizeLanguage("LuaJIT (2.0.4)")).toBe("Lua");
25+
expect(normalizeLanguage("Objective-C (Clang3.8.0)")).toBe("Objective-C");
26+
expect(normalizeLanguage("PyPy2 (7.3.0)")).toBe("Python");
27+
expect(normalizeLanguage("Python (Cython 0.29.34)")).toBe("Cython");
28+
expect(normalizeLanguage("Cython (0.29.16)")).toBe("Cython");
29+
expect(normalizeLanguage("Seed7 (Seed7 3.2.1)")).toBe("Seed7");
30+
31+
expect(normalizeLanguage("1234")).toBe("Unknown");
1032
});

0 commit comments

Comments
 (0)