Please sign in to comment.
Repair regex of mention and hashtag functions
Unquote the regex strings inside the `mention` and `hashtag` functions. Add test cases to test results of said functions. Remove superfluous A-Z charcter classes from regex as case-insensitive modifier is used. To ensure the tested tweet contains a mention and a hashtag, I also found it necessary to temporarily replace the `$.twitter` function with a mocked version that returns a pre-defined result. I have never used QUnit before, so I am not sure if there is a better way to go about this. It seems to work as intended. The tests originally failed. After unquoting the regex strings, the tests passed.
- Loading branch information...
Showing with 27 additions and 2 deletions.