summaryrefslogtreecommitdiff
path: root/tests/lexers/http
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2021-01-18 21:24:00 +0100
committerGeorg Brandl <georg@python.org>2021-01-18 22:08:36 +0100
commit2a3d3a7d5b9c60dedf6638d876161d9563faebcf (patch)
tree809c0b4a686db98f5954afa1944404cd9652c6b2 /tests/lexers/http
parentf0445be718da83541ea3401aad882f3937147263 (diff)
downloadpygments-git-examplefiles.tar.gz
Move test_examplefiles to new tests/lexers scheme.examplefiles
Diffstat (limited to 'tests/lexers/http')
-rw-r--r--tests/lexers/http/example.txt529
-rw-r--r--tests/lexers/http/example2.txt111
2 files changed, 640 insertions, 0 deletions
diff --git a/tests/lexers/http/example.txt b/tests/lexers/http/example.txt
new file mode 100644
index 00000000..ac3b678b
--- /dev/null
+++ b/tests/lexers/http/example.txt
@@ -0,0 +1,529 @@
+---input---
+HTTP/1.1 200 OK
+Date: Tue, 13 Dec 2011 00:11:44 GMT
+Status: 200 OK
+X-Transaction: 50b85fff78dab4a3
+X-RateLimit-Limit: 150
+ETag: "b31143be48ebfe7512b65fe64fe092f3"
+X-Frame-Options: SAMEORIGIN
+Last-Modified: Tue, 13 Dec 2011 00:11:44 GMT
+X-RateLimit-Remaining: 145
+X-Runtime: 0.01190
+X-Transaction-Mask: a6183ffa5f8ca943ff1b53b5644ef1145f6f285d
+Content-Type: application/json; charset=utf-8
+Content-Length: 2389
+Pragma: no-cache
+X-RateLimit-Class: api
+X-Revision: DEV
+Expires: Tue, 31 Mar 1981 05:00:00 GMT
+Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
+X-MID: a55f21733bc52bb11d1fc58f9b51b4974fbb8f83
+X-RateLimit-Reset: 1323738416
+Set-Cookie: k=10.34.234.116.1323735104238974; path=/;
+ expires=Tue, 20-Dec-11 00:11:44 GMT; domain=.twitter.com
+Set-Cookie: guest_id=v1%3A13237351042425496; domain=.twitter.com; path=/;
+ expires=Thu, 12-Dec-2013 12:11:44 GMT
+Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCPS6wjQ0AToHaWQiJTFiMTlhY2E1ZjczYThk%250ANDUwMWQxNjMwZGU2YTQ1ODBhIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--6b502f30a083e8a41a64f10930e142ea362b1561; domain=.twitter.com; path=/; HttpOnly
+Vary: Accept-Encoding
+Server: tfe
+
+[{"contributors_enabled":false,"profile_background_tile":true,"followers_count":644,"protected":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/69064242\/gb_normal.jpg","screen_name":"birkenfeld","default_profile_image":false,"following":null,"friends_count":88,"profile_sidebar_fill_color":"7AC3EE","url":"http:\/\/pythonic.pocoo.org\/","name":"Georg Brandl","default_profile":false,"is_translator":false,"utc_offset":3600,"profile_sidebar_border_color":"65B0DA","description":"","profile_background_image_url_https":"https:\/\/si0.twimg.com\/images\/themes\/theme10\/bg.gif","favourites_count":0,"profile_use_background_image":true,"created_at":"Tue Dec 30 22:25:11 +0000 2008","status":{"retweet_count":10,"favorited":false,"geo":null,"possibly_sensitive":false,"coordinates":null,"in_reply_to_screen_name":null,"in_reply_to_status_id_str":null,"retweeted":false,"in_reply_to_status_id":null,"in_reply_to_user_id_str":null,"created_at":"Sat Jul 09 13:42:35 +0000 2011","truncated":false,"id_str":"89690914515206144","contributors":null,"place":null,"source":"web","in_reply_to_user_id":null,"id":89690914515206144,"retweeted_status":{"retweet_count":10,"favorited":false,"geo":null,"possibly_sensitive":false,"coordinates":null,"in_reply_to_screen_name":null,"in_reply_to_status_id_str":null,"retweeted":false,"in_reply_to_status_id":null,"in_reply_to_user_id_str":null,"created_at":"Sat Jul 09 13:07:04 +0000 2011","truncated":false,"id_str":"89681976755372032","contributors":null,"place":null,"source":"web","in_reply_to_user_id":null,"id":89681976755372032,"text":"Excellent Python posts from @mitsuhiko - http:\/\/t.co\/k1wt6e4 and @ncoghlan_dev - http:\/\/t.co\/eTxacgZ (links fixed)"},"text":"RT @jessenoller: Excellent Python posts from @mitsuhiko - http:\/\/t.co\/k1wt6e4 and @ncoghlan_dev - http:\/\/t.co\/eTxacgZ (links fixed)"},"follow_request_sent":null,"statuses_count":553,"geo_enabled":false,"notifications":null,"profile_text_color":"3D1957","id_str":"18490730","lang":"en","profile_background_image_url":"http:\/\/a1.twimg.com\/images\/themes\/theme10\/bg.gif","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/69064242\/gb_normal.jpg","show_all_inline_media":true,"listed_count":65,"profile_link_color":"FF0000","verified":false,"id":18490730,"time_zone":"Berlin","profile_background_color":"642D8B","location":"Bavaria, Germany"}]
+
+---tokens---
+'HTTP' Keyword.Reserved
+'/' Operator
+'1.1' Literal.Number
+' ' Text
+'200' Literal.Number
+' ' Text
+'OK' Name.Exception
+'\n' Text
+
+'Date' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'Tue, 13 Dec 2011 00:11:44 GMT' Literal
+'\n' Text
+
+'Status' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'200 OK' Literal
+'\n' Text
+
+'X-Transaction' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'50b85fff78dab4a3' Literal
+'\n' Text
+
+'X-RateLimit-Limit' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'150' Literal
+'\n' Text
+
+'ETag' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'"b31143be48ebfe7512b65fe64fe092f3"' Literal
+'\n' Text
+
+'X-Frame-Options' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'SAMEORIGIN' Literal
+'\n' Text
+
+'Last-Modified' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'Tue, 13 Dec 2011 00:11:44 GMT' Literal
+'\n' Text
+
+'X-RateLimit-Remaining' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'145' Literal
+'\n' Text
+
+'X-Runtime' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'0.01190' Literal
+'\n' Text
+
+'X-Transaction-Mask' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'a6183ffa5f8ca943ff1b53b5644ef1145f6f285d' Literal
+'\n' Text
+
+'Content-Type' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'application/json; charset=utf-8' Literal
+'\n' Text
+
+'Content-Length' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'2389' Literal
+'\n' Text
+
+'Pragma' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'no-cache' Literal
+'\n' Text
+
+'X-RateLimit-Class' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'api' Literal
+'\n' Text
+
+'X-Revision' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'DEV' Literal
+'\n' Text
+
+'Expires' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'Tue, 31 Mar 1981 05:00:00 GMT' Literal
+'\n' Text
+
+'Cache-Control' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'no-cache, no-store, must-revalidate, pre-check=0, post-check=0' Literal
+'\n' Text
+
+'X-MID' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'a55f21733bc52bb11d1fc58f9b51b4974fbb8f83' Literal
+'\n' Text
+
+'X-RateLimit-Reset' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'1323738416' Literal
+'\n' Text
+
+'Set-Cookie' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'k=10.34.234.116.1323735104238974; path=/;' Literal
+'\n' Text
+
+'\t' Text
+'expires=Tue, 20-Dec-11 00:11:44 GMT; domain=.twitter.com' Literal
+'\n' Text
+
+'Set-Cookie' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'guest_id=v1%3A13237351042425496; domain=.twitter.com; path=/;' Literal
+'\n' Text
+
+'\t' Text
+'expires=Thu, 12-Dec-2013 12:11:44 GMT' Literal
+'\n' Text
+
+'Set-Cookie' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'_twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCPS6wjQ0AToHaWQiJTFiMTlhY2E1ZjczYThk%250ANDUwMWQxNjMwZGU2YTQ1ODBhIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--6b502f30a083e8a41a64f10930e142ea362b1561; domain=.twitter.com; path=/; HttpOnly' Literal
+'\n' Text
+
+'Vary' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'Accept-Encoding' Literal
+'\n' Text
+
+'Server' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'tfe' Literal
+'\n' Text
+
+'\n' Text
+
+'[{' Punctuation
+'"contributors_enabled"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"profile_background_tile"' Name.Tag
+':' Punctuation
+'true' Keyword.Constant
+',' Punctuation
+'"followers_count"' Name.Tag
+':' Punctuation
+'644' Literal.Number.Integer
+',' Punctuation
+'"protected"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"profile_image_url"' Name.Tag
+':' Punctuation
+'"http:\\/\\/a0.twimg.com\\/profile_images\\/69064242\\/gb_normal.jpg"' Literal.String.Double
+',' Punctuation
+'"screen_name"' Name.Tag
+':' Punctuation
+'"birkenfeld"' Literal.String.Double
+',' Punctuation
+'"default_profile_image"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"following"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"friends_count"' Name.Tag
+':' Punctuation
+'88' Literal.Number.Integer
+',' Punctuation
+'"profile_sidebar_fill_color"' Name.Tag
+':' Punctuation
+'"7AC3EE"' Literal.String.Double
+',' Punctuation
+'"url"' Name.Tag
+':' Punctuation
+'"http:\\/\\/pythonic.pocoo.org\\/"' Literal.String.Double
+',' Punctuation
+'"name"' Name.Tag
+':' Punctuation
+'"Georg Brandl"' Literal.String.Double
+',' Punctuation
+'"default_profile"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"is_translator"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"utc_offset"' Name.Tag
+':' Punctuation
+'3600' Literal.Number.Integer
+',' Punctuation
+'"profile_sidebar_border_color"' Name.Tag
+':' Punctuation
+'"65B0DA"' Literal.String.Double
+',' Punctuation
+'"description"' Name.Tag
+':' Punctuation
+'""' Literal.String.Double
+',' Punctuation
+'"profile_background_image_url_https"' Name.Tag
+':' Punctuation
+'"https:\\/\\/si0.twimg.com\\/images\\/themes\\/theme10\\/bg.gif"' Literal.String.Double
+',' Punctuation
+'"favourites_count"' Name.Tag
+':' Punctuation
+'0' Literal.Number.Integer
+',' Punctuation
+'"profile_use_background_image"' Name.Tag
+':' Punctuation
+'true' Keyword.Constant
+',' Punctuation
+'"created_at"' Name.Tag
+':' Punctuation
+'"Tue Dec 30 22:25:11 +0000 2008"' Literal.String.Double
+',' Punctuation
+'"status"' Name.Tag
+':{' Punctuation
+'"retweet_count"' Name.Tag
+':' Punctuation
+'10' Literal.Number.Integer
+',' Punctuation
+'"favorited"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"geo"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"possibly_sensitive"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"coordinates"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"in_reply_to_screen_name"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"in_reply_to_status_id_str"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"retweeted"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"in_reply_to_status_id"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"in_reply_to_user_id_str"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"created_at"' Name.Tag
+':' Punctuation
+'"Sat Jul 09 13:42:35 +0000 2011"' Literal.String.Double
+',' Punctuation
+'"truncated"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"id_str"' Name.Tag
+':' Punctuation
+'"89690914515206144"' Literal.String.Double
+',' Punctuation
+'"contributors"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"place"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"source"' Name.Tag
+':' Punctuation
+'"web"' Literal.String.Double
+',' Punctuation
+'"in_reply_to_user_id"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"id"' Name.Tag
+':' Punctuation
+'89690914515206144' Literal.Number.Integer
+',' Punctuation
+'"retweeted_status"' Name.Tag
+':{' Punctuation
+'"retweet_count"' Name.Tag
+':' Punctuation
+'10' Literal.Number.Integer
+',' Punctuation
+'"favorited"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"geo"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"possibly_sensitive"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"coordinates"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"in_reply_to_screen_name"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"in_reply_to_status_id_str"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"retweeted"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"in_reply_to_status_id"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"in_reply_to_user_id_str"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"created_at"' Name.Tag
+':' Punctuation
+'"Sat Jul 09 13:07:04 +0000 2011"' Literal.String.Double
+',' Punctuation
+'"truncated"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"id_str"' Name.Tag
+':' Punctuation
+'"89681976755372032"' Literal.String.Double
+',' Punctuation
+'"contributors"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"place"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"source"' Name.Tag
+':' Punctuation
+'"web"' Literal.String.Double
+',' Punctuation
+'"in_reply_to_user_id"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"id"' Name.Tag
+':' Punctuation
+'89681976755372032' Literal.Number.Integer
+',' Punctuation
+'"text"' Name.Tag
+':' Punctuation
+'"Excellent Python posts from @mitsuhiko - http:\\/\\/t.co\\/k1wt6e4 and @ncoghlan_dev - http:\\/\\/t.co\\/eTxacgZ (links fixed)"' Literal.String.Double
+'},' Punctuation
+'"text"' Name.Tag
+':' Punctuation
+'"RT @jessenoller: Excellent Python posts from @mitsuhiko - http:\\/\\/t.co\\/k1wt6e4 and @ncoghlan_dev - http:\\/\\/t.co\\/eTxacgZ (links fixed)"' Literal.String.Double
+'},' Punctuation
+'"follow_request_sent"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"statuses_count"' Name.Tag
+':' Punctuation
+'553' Literal.Number.Integer
+',' Punctuation
+'"geo_enabled"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"notifications"' Name.Tag
+':' Punctuation
+'null' Keyword.Constant
+',' Punctuation
+'"profile_text_color"' Name.Tag
+':' Punctuation
+'"3D1957"' Literal.String.Double
+',' Punctuation
+'"id_str"' Name.Tag
+':' Punctuation
+'"18490730"' Literal.String.Double
+',' Punctuation
+'"lang"' Name.Tag
+':' Punctuation
+'"en"' Literal.String.Double
+',' Punctuation
+'"profile_background_image_url"' Name.Tag
+':' Punctuation
+'"http:\\/\\/a1.twimg.com\\/images\\/themes\\/theme10\\/bg.gif"' Literal.String.Double
+',' Punctuation
+'"profile_image_url_https"' Name.Tag
+':' Punctuation
+'"https:\\/\\/si0.twimg.com\\/profile_images\\/69064242\\/gb_normal.jpg"' Literal.String.Double
+',' Punctuation
+'"show_all_inline_media"' Name.Tag
+':' Punctuation
+'true' Keyword.Constant
+',' Punctuation
+'"listed_count"' Name.Tag
+':' Punctuation
+'65' Literal.Number.Integer
+',' Punctuation
+'"profile_link_color"' Name.Tag
+':' Punctuation
+'"FF0000"' Literal.String.Double
+',' Punctuation
+'"verified"' Name.Tag
+':' Punctuation
+'false' Keyword.Constant
+',' Punctuation
+'"id"' Name.Tag
+':' Punctuation
+'18490730' Literal.Number.Integer
+',' Punctuation
+'"time_zone"' Name.Tag
+':' Punctuation
+'"Berlin"' Literal.String.Double
+',' Punctuation
+'"profile_background_color"' Name.Tag
+':' Punctuation
+'"642D8B"' Literal.String.Double
+',' Punctuation
+'"location"' Name.Tag
+':' Punctuation
+'"Bavaria, Germany"' Literal.String.Double
+'}]' Punctuation
+'\n' Text
diff --git a/tests/lexers/http/example2.txt b/tests/lexers/http/example2.txt
new file mode 100644
index 00000000..c41b582e
--- /dev/null
+++ b/tests/lexers/http/example2.txt
@@ -0,0 +1,111 @@
+---input---
+POST /demo/submit/ HTTP/1.1
+Host: pygments.org
+Connection: keep-alivk
+Cache-Control: max-age=0
+Origin: http://pygments.org
+User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2)
+ AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
+Content-Type: application/x-www-form-urlencoded
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
+Referer: http://pygments.org/
+Accept-Encoding: gzip,deflate,sdch
+Accept-Language: en-US,en;q=0.8
+Accept-Charset: windows-949,utf-8;q=0.7,*;q=0.3
+
+name=test&lang=text&code=asdf&user=
+
+---tokens---
+'POST' Name.Function
+' ' Text
+'/demo/submit/' Name.Namespace
+' ' Text
+'HTTP' Keyword.Reserved
+'/' Operator
+'1.1' Literal.Number
+'\n' Text
+
+'Host' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'pygments.org' Literal
+'\n' Text
+
+'Connection' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'keep-alivk' Literal
+'\n' Text
+
+'Cache-Control' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'max-age=0' Literal
+'\n' Text
+
+'Origin' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'http://pygments.org' Literal
+'\n' Text
+
+'User-Agent' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2)' Literal
+'\n' Text
+
+' ' Text
+'AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7' Literal
+'\n' Text
+
+'Content-Type' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'application/x-www-form-urlencoded' Literal
+'\n' Text
+
+'Accept' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' Literal
+'\n' Text
+
+'Referer' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'http://pygments.org/' Literal
+'\n' Text
+
+'Accept-Encoding' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'gzip,deflate,sdch' Literal
+'\n' Text
+
+'Accept-Language' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'en-US,en;q=0.8' Literal
+'\n' Text
+
+'Accept-Charset' Name.Attribute
+'' Text
+':' Operator
+' ' Text
+'windows-949,utf-8;q=0.7,*;q=0.3' Literal
+'\n' Text
+
+'\n' Text
+
+'name=test&lang=text&code=asdf&user=\n' Text