forked from twitter-archive/twitter-text-conformance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate.yml
178 lines (135 loc) · 5.92 KB
/
validate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
tests:
tweets:
- description: "Valid Tweet: < 20 characters"
text: "I am a Tweet"
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"
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"
expected: true
- description: "Valid Tweet: 140 characters (double byte chracters)"
text: "のののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののののの"
expected: true
- description: "Invalid Tweet: 141 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"
expected: false
- description: "Invalid Tweet: 141 characters (due to newline)"
text: "A lie gets halfway around the world before the truth has a chance to get its pants on. \n-- Winston Churchill (1874-1965) http://bit.ly/dJpywL"
expected: false
usernames:
- description: "Valid username: a-z < 20 characters"
text: "@username"
expected: true
- description: "All numeric username are allowed"
text: "@12345"
expected: true
- description: "Usernames should allow the _ character"
text: "@example_name"
expected: true
- description: "Usernames SHOULD NOT allow the - character"
text: "@example-name"
expected: false
lists:
- description: "Valid list: a-z < 20 characters"
text: "@username/list"
expected: true
- description: "A username alone SHOULD NOT be considered a valid list"
text: "@username"
expected: false
- description: "A username followed by a slash SHOULD NOT be considered a valid list"
text: "@username/"
expected: false
- description: "Validation SHOULD NOT allow leading spaces"
text: " @username/list"
expected: false
- description: "Validation SHOULD NOT allow trailing spaces"
text: "@username/list "
expected: false
hashtags:
- description: "Valid hashtag: a-z < 20 characters"
text: "#hashtag"
expected: true
- description: "Valid hashtag: number followed by letters"
text: "#1st"
expected: true
- description: "Valid hashtag: letters and numbers mixed"
text: "#that1time"
expected: true
- description: "Valid hashtag: letter followed by numbers"
text: "#easyas123"
expected: true
- description: "Invalid hashtag: all numbers"
text: "#12345"
expected: false
- description: "Valid hashtag: Russian text"
text: "#ашок"
expected: true
- description: "Valid hashtag: Korean text"
text: "#트위터"
expected: true
urls:
- description: "Valid url: protocol + domain"
text: "http://example.com"
expected: true
- description: "Valid url: ssl + domain + path + query"
text: "https://example.com/path/to/resource?search=foo&lang=en"
expected: true
- description: "Valid url: protocol + domain + path + fragment"
text: "http://twitter.com/#!/twitter"
expected: true
- description: "Valid url: cased protocol and domain"
text: "HTTPS://www.ExaMPLE.COM/index.html"
expected: true
- description: "Valid url: port and userinfo"
text: "http://user:[email protected]:8080/login.php"
expected: true
- description: "Valid url: matrix path parameters"
text: "http://sports.yahoo.com/nfl/news;_ylt=Aom0;ylu=XyZ?slug=ap-superbowlnotebook"
expected: true
- description: "Valid url: ipv4"
text: "http://192.168.0.1/index.html?src=asdf"
expected: true
- description: "Valid url: ipv6"
text: "http://[3ffe:1900:4545:3:200:f8ff:fe21:67cf]:80/index.html"
expected: true
- description: "Valid url: underscore in subdomain"
text: "http://test_underscore.twitter.com"
expected: true
- description: "Valid url: sub delims and question marks"
text: "http://example.com?foo=$bar.;baz?BAZ&c=d-#top/?stories+"
expected: true
- description: "Valid unicode url: unicode domain"
text: "http://☃.net/"
expected: true
- description: "Invalid url: invalid scheme"
text: "ftp://www.example.com/"
expected: false
- description: "Invalid url: invalid userinfo characters"
text: "https://user:pass[word]@www.example.com/"
expected: false
- description: "Invalid url: underscore in domain"
text: "http://domain-dash_2314352345_dfasd.foo-cow_4352.com"
expected: false
- description: "Invalid url: domain beginning dash"
text: "http://www.-domain4352.com/"
expected: false
- description: "Invalid url: domain trailing dash"
text: "http://www.domain4352-.com/"
expected: false
- description: "Invalid url: unicode domain trailing dash"
text: "http://☃-.net/"
expected: false
- description: "Invalid url: improperly encoded unicode domain"
text: "http://%e2%98%83.net/"
expected: false
- description: "Invalid url: invalid IP"
text: "http://256.1.2.3/"
expected: false
- description: "Invalid url: invalid char in path"
text: "http://en.wikipedia.org/wiki/\"#Punctuation"
expected: false
- description: "Invalid url: trailing space"
text: "http://example.com/#anchor "
expected: false