Files
pangu.hs/test/Main.hs
2026-01-03 17:03:47 +08:00

28 lines
1.2 KiB
Haskell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import MyLib
import Test.Hspec
main :: IO ()
main = hspec $ do
describe "MyLib.cjksym(cjk)" $ do
it "converts symbols to fullwidth" $ do
pangu "你 : 好" `shouldBe` "你:好"
pangu "你.好" `shouldBe` "你。好"
pangu "你:好:他" `shouldBe` "你:好:他"
pangu "你 ? 好" `shouldBe` "你?好"
pangu "你…好" `shouldBe` "你… 好"
pangu "你...好" `shouldBe` "你... 好"
pangu "你:0" `shouldBe` "0"
it "fixes quotes" $ do
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"