Improve test coverage to ~100%

This commit is contained in:
Leonel Quinteros
2016-06-26 12:15:08 -03:00
parent 2c5ca9c0e6
commit 21c6bc86cb
3 changed files with 52 additions and 33 deletions

View File

@@ -47,7 +47,7 @@ msgstr[2] "And this is the second plural form: %s"
// Create Locale with full language code
l := NewLocale("/tmp", "en_US")
// Force nil domain storage
l.domains = nil
@@ -71,13 +71,13 @@ msgstr[2] "And this is the second plural form: %s"
if tr != "And this is the second plural form: Variable" {
t.Errorf("Expected 'And this is the second plural form: Variable' but got '%s'", tr)
}
// Test non-existent "deafult" domain responses
tr = l.Get("My text")
if tr != "My text" {
t.Errorf("Expected 'My text' but got '%s'", tr)
}
tr = l.GetN("One with var: %s", "Several with vars: %s", 2, v)
if tr != "Several with vars: Variable" {
t.Errorf("Expected 'Several with vars: Variable' but got '%s'", tr)