Improve test coverage to ~100%
This commit is contained in:
19
po_test.go
19
po_test.go
@@ -93,6 +93,25 @@ msgstr[0] "Badly formatted string'
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTranslationObject(t *testing.T) {
|
||||||
|
tr := newTranslation()
|
||||||
|
str := tr.get()
|
||||||
|
|
||||||
|
if str != "" {
|
||||||
|
t.Errorf("Expected '' but got '%s'", str)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set id
|
||||||
|
tr.id = "Text"
|
||||||
|
|
||||||
|
// Get again
|
||||||
|
str = tr.get()
|
||||||
|
|
||||||
|
if str != "Text" {
|
||||||
|
t.Errorf("Expected 'Text' but got '%s'", str)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestPoRace(t *testing.T) {
|
func TestPoRace(t *testing.T) {
|
||||||
// Set PO content
|
// Set PO content
|
||||||
str := `# Some comment
|
str := `# Some comment
|
||||||
|
|||||||
Reference in New Issue
Block a user