【发布时间】:2013-10-08 01:43:25
【问题描述】:
我有一个单元测试文件:
module X04PatMatTest where
import AssertError
import Test.HUnit
import X04PatMat
...
然后 hlint 抱怨:
X04PatMatTest.hs:15:69: Warning: Use string literal
Found:
['a', 'b', 'd']
Why not:
"abd"
由于种种原因,我很想把['a', 'b', 'd']放在测试代码中。
我尝试了各种排列方式
{-# ANN X04PatMatTest "HLint: ignore Warning: Use string literal" #-}
就像将编译指示作为文件的第一行,在模块声明之后,名称为module 而不是X04...,将Warning 更改为warn ...
什么是魔法?
【问题讨论】: