+ [ 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" $
+ 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)
+
+ expected :: [String]
+ expected =
+ map (\x -> tsn_db_field_namer "herp" "derp" 8675309 x 90210) field_names
+
+ actual :: [String]
+ actual = ["mid", "sport", "url", "sms", "editor", "text", "continue"]