Update syntax test

This commit is contained in:
Corey Richardson 2013-09-16 19:12:54 -04:00
parent bb4d4d7eb9
commit d0e0c336d0

View File

@ -398,7 +398,129 @@ mod test {
#[test] fn string_to_tts_1 () {
let (tts,_ps) = string_to_tts_and_sess(@"fn a (b : int) { b; }");
assert_eq!(to_json_str(@tts),
~"[{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"fn\",false]}]},{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"a\",false]}]},{\"variant\":\"tt_delim\",\"fields\":[[{\"variant\":\"tt_tok\",\"fields\":[null,\"LPAREN\"]},{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"b\",false]}]},{\"variant\":\"tt_tok\",\"fields\":[null,\"COLON\"]},{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"int\",false]}]},{\"variant\":\"tt_tok\",\"fields\":[null,\"RPAREN\"]}]]},{\"variant\":\"tt_delim\",\"fields\":[[{\"variant\":\"tt_tok\",\"fields\":[null,\"LBRACE\"]},{\"variant\":\"tt_tok\",\"fields\":[null,{\"variant\":\"IDENT\",\"fields\":[\"b\",false]}]},{\"variant\":\"tt_tok\",\"fields\":[null,\"SEMI\"]},{\"variant\":\"tt_tok\",\"fields\":[null,\"RBRACE\"]}]]}]"
~"[\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
{\
\"variant\":\"IDENT\",\
\"fields\":[\
\"fn\",\
false\
]\
}\
]\
},\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
{\
\"variant\":\"IDENT\",\
\"fields\":[\
\"a\",\
false\
]\
}\
]\
},\
{\
\"variant\":\"tt_delim\",\
\"fields\":[\
[\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
\"LPAREN\"\
]\
},\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
{\
\"variant\":\"IDENT\",\
\"fields\":[\
\"b\",\
false\
]\
}\
]\
},\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
\"COLON\"\
]\
},\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
{\
\"variant\":\"IDENT\",\
\"fields\":[\
\"int\",\
false\
]\
}\
]\
},\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
\"RPAREN\"\
]\
}\
]\
]\
},\
{\
\"variant\":\"tt_delim\",\
\"fields\":[\
[\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
\"LBRACE\"\
]\
},\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
{\
\"variant\":\"IDENT\",\
\"fields\":[\
\"b\",\
false\
]\
}\
]\
},\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
\"SEMI\"\
]\
},\
{\
\"variant\":\"tt_tok\",\
\"fields\":[\
null,\
\"RBRACE\"\
]\
}\
]\
]\
}\
]"
);
}