Skip to content
Browse files

Merge pull request #45 from twitter/tweet_length

Add test cases for counting tweet length
  • Loading branch information...
2 parents 678e646 + 21884bf commit 556b6f4f35da0c7a24db8aafd9be6a97369cd880 @psychs psychs committed May 18, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 validate.yml
View
21 validate.yml
@@ -201,3 +201,24 @@ tests:
- description: "Valid url without protocol: domain + path + query"
text: "example.com/path/to/resource?search=foo&lang=en"
expected: true
+
+ lengths:
+ - description: "Count the number of characters"
+ text: "This is a test."
+ expected: 15
+
+ - description: "Count a URL starting with http:// as 20 characters"
+ text: "http://test.com"
+ expected: 20
+
+ - description: "Count a URL starting with https:// as 21 characters"
+ text: "https://test.com"
+ expected: 21
+
+ - description: "Count a URL without protocol as 20 characters"
+ text: "test.com"
+ expected: 20
+
+ - description: "Count multiple URLs correctly"
+ text: "Test http://test.com test http://test.com test.com test"
+ expected: 77

0 comments on commit 556b6f4

Please sign in to comment.
Something went wrong with that request. Please try again.