Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

new tests for longer t.co lengths and unicode chars outside basic multil... #50

Merged
merged 1 commit into from

2 participants

@twuttke
Collaborator

...ingual plane

@jakl jakl merged commit 5a1e4e1 into from
@jakl jakl deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 8, 2013
  1. new tests for longer t.co lengths and unicode chars outside basic mul…

    Tom Wuttke authored
    …tilingual plane
This page is out of date. Refresh to see the latest.
Showing with 25 additions and 9 deletions.
  1. +25 −9 validate.yml
View
34 validate.yml
@@ -6,17 +6,21 @@ tests:
expected: true
- description: "Valid Tweet: 140 characters"
- text: "A lie gets halfway around the world before the truth has a chance to get its pants on. -- Winston Churchill (1874-1965) http://bit.ly/dJpywL"
+ text: "A lie gets halfway around the world before the truth has a chance to get its pants on. Winston Churchill (1874-1965) http://bit.ly/dJpywL"
expected: true
- description: "Valid Tweet: 140 characters (with accents)"
- text: "A lié géts halfway arøünd thé wørld béføré thé truth has a chance tø get its pants øn. -- Winston Churchill (1874-1965) http://bit.ly/dJpywL"
+ text: "A lié géts halfway arøünd thé wørld béføré thé truth has a chance tø get its pants øn. Winston Churchill (1874-1965) http://bit.ly/dJpywL"
expected: true
- description: "Valid Tweet: 140 characters (double byte characters)"
text: "のののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののの"
expected: true
+ - description: "Valid Tweet: 140 characters (double word characters)"
+ text: "🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱"
+ expected: true
+
- description: "Invalid Tweet: no characters (empty)"
text: ""
expected: false
@@ -207,18 +211,30 @@ tests:
text: "This is a test."
expected: 15
- - description: "Count a URL starting with http:// as 20 characters"
+ - description: "Count a URL starting with http:// as 22 characters"
text: "http://test.com"
- expected: 20
+ expected: 22
- - description: "Count a URL starting with https:// as 21 characters"
+ - description: "Count a URL starting with https:// as 23 characters"
text: "https://test.com"
- expected: 21
+ expected: 23
- - description: "Count a URL without protocol as 20 characters"
+ - description: "Count a URL without protocol as 22 characters"
text: "test.com"
- expected: 20
+ expected: 22
- description: "Count multiple URLs correctly"
text: "Test http://test.com test http://test.com test.com test"
- expected: 77
+ expected: 83
+
+ - description: "Count unicode chars outside the basic multilingual plane (double word)"
+ text: "𐀀􏿿"
+ expected: 2
+
+ - description: "Count unicode chars inside the basic multilingual plane"
+ text: "저찀쯿쿿"
+ expected: 4
+
+ - description: "Count a mix of single byte single word, and double word unicode characters"
+ text: "H🐱☺"
+ expected: 3
Something went wrong with that request. Please try again.