This commit is contained in:
2026-01-03 17:03:47 +08:00
parent 5ba00b7fc9
commit 0418e29edf
2 changed files with 103 additions and 24 deletions

View File

@@ -8,15 +8,21 @@ main :: IO ()
main = hspec $ do
describe "MyLib.cjksym(cjk)" $ do
it "converts symbols to fullwidth" $ do
applyRules myRules "你 : 好" `shouldBe` "你:好"
applyRules myRules "你.好" `shouldBe` "你。好"
applyRules myRules "你:好:他" `shouldBe` "你:好:他"
applyRules myRules "你 ? 好" `shouldBe` "你?好"
applyRules myRules "你…好" `shouldBe` "你… 好"
applyRules myRules "你...好" `shouldBe` "你... 好"
applyRules myRules "你:0" `shouldBe` "0"
pangu "你 : 好" `shouldBe` "你:好"
pangu "你.好" `shouldBe` "你。好"
pangu "你:好:他" `shouldBe` "你:好:他"
pangu "你 ? 好" `shouldBe` "你?好"
pangu "你…好" `shouldBe` "你… 好"
pangu "你...好" `shouldBe` "你... 好"
pangu "你:0" `shouldBe` "0"
it "fixes quotes" $ do
applyRules myRules "我说:\" 他说:'你好'\"" `shouldBe` "我说:\"他说:' 你好 '\""
-- applyRules myRules "'你好'" `shouldBe` "' 你好'" -- strange behavior
applyRules myRules "你'hello'" `shouldBe` "你 'hello'"
applyRules myRules "我 's " `shouldBe` "我's "
pangu "我说:\" 他说:'你好'\"" `shouldBe` "我说:\"他说:' 你好 '\""
-- pangu "'你好'" `shouldBe` "' 你好'" -- strange behavior
pangu "你'hello'" `shouldBe` "你 'hello'"
pangu "我 's " `shouldBe` "我's "
it "fixes hash" $ do
pangu "你好#测试#世界" `shouldBe` "你好 #测试# 世界"
it "add spaces" $ do
pangu "你好and世界" `shouldBe` "你好 and 世界"
pangu "當你凝視著bugbug也凝視著你" `shouldBe` "當你凝視著 bugbug 也凝視著你"
pangu "與PM戰鬥的人,應當小心自己不要成為PM" `shouldBe` "與 PM 戰鬥的人,應當小心自己不要成為 PM"