+ [ test_news_fields_have_correct_names,
+ test_pickle_of_unpickle_is_identity,
+ test_unpickle_succeeds ]
+
+
+test_news_fields_have_correct_names :: TestTree
+test_news_fields_have_correct_names =
+ testCase "news fields get correct database names" $ do
+ mapM_ check (zip actual expected)
+ where
+ -- This is cool, it uses the (derived) Data instance of
+ -- News.Message to get its constructor names.
+ field_names :: [String]
+ field_names =
+ constrFields . head $ dataTypeConstrs $ dataTypeOf (undefined :: Message)