1
0
mirror of https://github.com/fumiama/emozi.git synced 2026-06-10 13:00:27 +08:00

optimize(data): 缓存更新逻辑

This commit is contained in:
源文雨
2024-02-16 15:45:21 +09:00
parent 3adb6a8f0f
commit 86892593e7
4 changed files with 148 additions and 90 deletions

View File

@@ -10,6 +10,7 @@ func TestEncode(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer c.Close()
es, lst, err := c.Encode(false, "你好,世界!看看多音字:行。")
if err != nil {
t.Fatal(err)
@@ -30,11 +31,11 @@ func TestEncode(t *testing.T) {
if len(lst) != 2 && lst[0] != 2 && lst[1] != 2 {
t.Fail()
}
es, _, err = c.Encode(false, "")
es, _, err = c.Encode(false, "")
if err != nil {
t.Fatal(err)
}
if es.String() != "🈳🈳🈳" {
if es.String() != "🈳🈳🈳" {
t.Fatal("got", es.String())
}
}
@@ -44,6 +45,7 @@ func TestDecode(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer c.Close()
s := "你好,世界!看看多音字:行。"
es, _, err := c.Encode(false, s)
if err != nil {