...
1
2
3
4
5 package gettext
6
7 import (
8 "testing"
9 )
10
11 func TestFileSystem_os(t *testing.T) {
12 fs := OS("./examples/locale")
13 tAssert(t, fs.String() == "gettext.localfs(./examples/locale)", fs.String())
14
15 testExamplesLocal(t, fs)
16 }
17
18 func TestFileSystem_zip(t *testing.T) {
19 fs := NewFS("./examples/locale.zip", nil)
20 tAssert(t, fs.String() == "gettext.zipfs(./examples/locale.zip)", fs.String())
21
22 testExamplesLocal(t, fs)
23 }
24
25 func testExamplesLocal(t *testing.T, fs FileSystem) {
26 localeList := fs.LocaleList()
27 tAssert(t, len(localeList) == 3, localeList)
28 tAssert(t, localeList[0] == "default")
29 tAssert(t, localeList[1] == "zh_CN")
30 tAssert(t, localeList[2] == "zh_TW")
31 }
32
View as plain text