i18n_test.go
·
21 lines
·
436 B
| 1 | package i18n |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | // TestTranslationParity ensures both dictionaries expose the same keys. |
| 6 | func TestTranslationParity(t *testing.T) { |
| 7 | ru, en := translations[RU], translations[EN] |
| 8 | for k := range ru { |
| 9 | if _, ok := en[k]; !ok { |
| 10 | t.Errorf("EN is missing key %q", k) |
| 11 | } |
| 12 | } |
| 13 | for k := range en { |
| 14 | if _, ok := ru[k]; !ok { |
| 15 | t.Errorf("RU is missing key %q", k) |
| 16 | } |
| 17 | } |
| 18 | if len(ru) == 0 { |
| 19 | t.Fatal("empty dictionary") |
| 20 | } |
| 21 | } |
| 22 |