MCPcopy Create free account
hub / github.com/appleboy/CodeGPT / TestGetLanguage

Function TestGetLanguage

prompt/language_test.go:5–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3import "testing"
4
5func TestGetLanguage(t *testing.T) {
6 testCases := []struct {
7 langCode string
8 expected string
9 }{
10 {"en", DefaultLanguage},
11 {"zh-tw", "Traditional Chinese"},
12 {"zh-cn", "Simplified Chinese"},
13 {"ja", "Japanese"},
14 {"fr", DefaultLanguage},
15 }
16
17 for _, tc := range testCases {
18 result := GetLanguage(tc.langCode)
19 if result != tc.expected {
20 t.Errorf("GetLanguage(%q) = %q, expected %q", tc.langCode, result, tc.expected)
21 }
22 }
23}

Callers

nothing calls this directly

Calls 1

GetLanguageFunction · 0.85

Tested by

no test coverage detected