Replace HTML entities once more.
options :: [OptDescr (Options -> IO Options)]
options =
[ Option
- [] ["consumer_key"]
- (ReqArg set_consumer_key "consumer_key")
+ [] ["consumer-key"]
+ (ReqArg set_consumer_key "consumer-key")
"Your Twitter API consumer key.",
Option
- [] ["consumer_secret"]
- (ReqArg set_consumer_secret "consumer_secret")
+ [] ["consumer-secret"]
+ (ReqArg set_consumer_secret "consumer-secret")
"Your Twitter API consumer secret.",
Option
- [] ["access_token"]
- (ReqArg set_access_token "access_token")
+ [] ["access-token"]
+ (ReqArg set_access_token "access-token")
"Your Twitter API access token.",
Option
- [] ["access_secret"]
- (ReqArg set_access_secret "access_secret")
+ [] ["access-secret"]
+ (ReqArg set_access_secret "access-secret")
"Your Twitter API access secret.",
Option
-- | The usage header.
usage :: String
-usage = "Usage: twat --consumer_key=<key> --consumer_secret=<secret> --access_token=<key> --access_secret=<secret> [-n heartbeat] [-t to_address] [-f from_address] [-s path-to-sendmail] <username1> [username2, [username3]...]"
+usage = "Usage: twat --consumer-key=<key> --consumer-secret=<secret> --access-token=<key> --access-secret=<secret> [-n heartbeat] [-t to_address] [-f from_address] [-s path-to-sendmail] <username1> [username2, [username3]...]"
-- | Was the help option passed?
test_listify :: Test
test_listify =
- TestCase $ assertEqual "All items are numbered correctly." expected_items actual_items
+ TestCase $ assertEqual description expected_items actual_items
where
+ description = "All items are numbered correctly."
actual_items = listify [ "item1", "item2" ]
expected_items = ["1. item1", "2. item2" ]
import Test.HUnit
import Text.Regex (matchRegex, mkRegex)
+import Html (replace_entities)
import StringUtils (listify)
import Twitter.User
(t .: id_field) <*>
liftM isJustInt (t .: in_reply_to_status_id_field) <*>
(t .: retweeted_field) <*>
- (t .: text_field) <*>
+ liftM replace_entities (t .: text_field) <*>
(t .: user_field)
where
-- The typechecker flips out without this.
import StringUtils (string_utils_tests)
import Twitter.Status(status_tests)
-import Twitter.Xml(xml_tests)
+import Html(html_tests)
-- The list of HUnit tests.
-test_suite = TestList (concat [xml_tests, status_tests, string_utils_tests])
+test_suite = TestList (concat [html_tests, status_tests, string_utils_tests])
main :: IO ()
main = do
putStrLn "HUnit"
putStrLn "-----"
runTestTT test_suite
- return ()
\ No newline at end of file
+ return ()
process == 1.*,
old-locale == 1.*,
regex-compat == 0.*,
+ tagsoup == 0.12.*,
text == 0.11.*,
time == 1.*