mirror of https://github.com/koreader/koreader
Add gettext_spec stub (#3343)
parent
d8ca501cbd
commit
a394e644b5
@ -0,0 +1,25 @@
|
||||
describe("GetText module", function()
|
||||
local GetText
|
||||
setup(function()
|
||||
require("commonrequire")
|
||||
GetText = require("gettext")
|
||||
end)
|
||||
describe("changeLang", function()
|
||||
it("should return nil when passing newlang = C", function()
|
||||
assert.is_nil(GetText.changeLang("C"))
|
||||
end)
|
||||
it("should return nil when passing empty string or nil value", function()
|
||||
assert.is_nil(GetText.changeLang(nil))
|
||||
assert.is_nil(GetText.changeLang(""))
|
||||
end)
|
||||
it("should return nil when passing values that start with en_US", function()
|
||||
assert.is_nil(GetText.changeLang("en_US"))
|
||||
assert.is_nil(GetText.changeLang("en_US:en"))
|
||||
assert.is_nil(GetText.changeLang("en_US.utf8"))
|
||||
end)
|
||||
it("should return false when it can't find a po file", function()
|
||||
assert.is_false(GetText.changeLang("nonsense"))
|
||||
assert.is_false(GetText.changeLang("more_NONSENSE"))
|
||||
end)
|
||||
end)
|
||||
end)
|
Loading…
Reference in New Issue