1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-17 20:58:08 +02:00

Add HTTP unit test

This commit is contained in:
Daniel G. Taylor 2018-10-02 12:31:01 -07:00 committed by Alec Thomas
parent eafa8e1c69
commit 0955241525
2 changed files with 32 additions and 0 deletions

5
lexers/testdata/http.actual vendored Normal file
View File

@ -0,0 +1,5 @@
GET /foo HTTP/1.1
Content-Type: application/json
User-Agent: foo
{"hello": "world"}

27
lexers/testdata/http.expected vendored Normal file
View File

@ -0,0 +1,27 @@
[
{"type":"NameFunction","value":"GET"},
{"type":"Text","value":" "},
{"type":"NameNamespace","value":"/foo"},
{"type":"Text","value":" "},
{"type":"KeywordReserved","value":"HTTP"},
{"type":"Operator","value":"/"},
{"type":"LiteralNumber","value":"1.1"},
{"type":"Text","value":"\n"},
{"type":"Name","value":"Content-Type"},
{"type":"Operator","value":":"},
{"type":"Text","value":" "},
{"type":"Literal","value":"application/json"},
{"type":"Text","value":"\n"},
{"type":"Name","value":"User-Agent"},
{"type":"Operator","value":":"},
{"type":"Text","value":" "},
{"type":"Literal","value":"foo"},
{"type":"Text","value":"\n\n"},
{"type":"Punctuation","value":"{"},
{"type":"NameTag","value":"\"hello\""},
{"type":"Punctuation","value":":"},
{"type":"Text","value":" "},
{"type":"LiteralStringDouble","value":"\"world\""},
{"type":"Punctuation","value":"}"},
{"type":"Text","value":"\n"}
]