-
-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathlanguages_spec.lua
53 lines (42 loc) · 1.75 KB
/
languages_spec.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
SILE = require("core.sile")
describe("Language module", function ()
it("should set env locale", function ()
SILE.call("language", { main = "tr" })
local syslang = os.getenv("LANG")
assert.is.equal("tr", syslang)
end)
describe("Norwegian", function ()
local hyphenate = SILE.showHyphenationPoints
SILE.call("language", { main = "no" })
it("should hyphenate", function ()
assert.is.equal("Nor-we-gian", hyphenate("Norwegian", "no"))
assert.is.equal("atten-de", hyphenate("attende", "no"))
end)
it("should have localizations", function ()
local hello = fluent:get_message("hello")({ name = "Busted" })
assert.is.equal("Hei <em>Busted</em>!", hello)
end)
describe("Norwegian Bokmål", function ()
SILE.call("language", { main = "nb" })
it("should hyphenate", function ()
assert.is.equal("Nor-we-gian", hyphenate("Norwegian", "nb"))
assert.is.equal("atten-de", hyphenate("attende", "nb"))
end)
it("should have localizations", function ()
local hello = fluent:get_message("hello")({ name = "Busted" })
assert.is.equal("Hei <em>Busted</em>!", hello)
end)
end)
describe("Norwegian Nynorsk", function ()
SILE.call("language", { main = "nn" })
it("should hyphenate", function ()
assert.is.equal("Nor-we-gian", hyphenate("Norwegian", "nn"))
assert.is.equal("att-en-de", hyphenate("attende", "nn"))
end)
it("should have localizations", function ()
local hello = fluent:get_message("hello")({ name = "Busted" })
assert.is.equal("Hei <em>Busted</em>!", hello)
end)
end)
end)
end)