(t *testing.T)
| 39 | } |
| 40 | |
| 41 | func TestTranslationPlural(t *testing.T) { |
| 42 | err := LoadTranslations("test", func() string { return "default" }) |
| 43 | if err != nil { |
| 44 | t.Errorf("Unexpected error: %v", err) |
| 45 | } |
| 46 | |
| 47 | result := T("test_plural", 3) |
| 48 | if result != "there were 3 items" { |
| 49 | t.Errorf("expected: %s, saw: %s", "there were 3 items", result) |
| 50 | } |
| 51 | |
| 52 | result = T("test_plural", 1) |
| 53 | if result != "there was 1 item" { |
| 54 | t.Errorf("expected: %s, saw: %s", "there was 1 item", result) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | func TestTranslationUsingEnvVar(t *testing.T) { |
| 59 | // We must backup and restore env vars before setting test values in tests |
nothing calls this directly
no test coverage detected
searching dependent graphs…