Update tokenize_test.rs

This commit is contained in:
Shunsuke Shibayama 2022-09-15 15:26:39 +09:00
parent 1b37976701
commit 042ea70ec6

View file

@ -58,6 +58,7 @@ fn test_lexer_for_basic() -> ParseResult<()> {
(BoolLit, "True"), (BoolLit, "True"),
(Comma, ","), (Comma, ","),
(Symbol, "do!"), (Symbol, "do!"),
(Colon, ":"),
(Newline, newline), (Newline, newline),
(Indent, " "), (Indent, " "),
(Symbol, "print!"), (Symbol, "print!"),
@ -67,6 +68,7 @@ fn test_lexer_for_basic() -> ParseResult<()> {
(Dot, "."), (Dot, "."),
(Symbol, "times!"), (Symbol, "times!"),
(Symbol, "do!"), (Symbol, "do!"),
(Colon, ":"),
(Newline, newline), (Newline, newline),
(Indent, " "), (Indent, " "),
(Symbol, "if!"), (Symbol, "if!"),
@ -77,6 +79,7 @@ fn test_lexer_for_basic() -> ParseResult<()> {
(Symbol, "z"), (Symbol, "z"),
(Comma, ","), (Comma, ","),
(Symbol, "do!"), (Symbol, "do!"),
(Colon, ":"),
(Newline, newline), (Newline, newline),
(Indent, " "), (Indent, " "),
(Symbol, "print!"), (Symbol, "print!"),
@ -134,73 +137,6 @@ fn test_lexer_for_advanced() -> ParseResult<()> {
(Newline, newline), (Newline, newline),
(Newline, newline), (Newline, newline),
(Newline, newline), (Newline, newline),
(Symbol, "f"),
(Symbol, "x"),
(Equal, "="),
(NatLit, "1"),
(Plus, "+"),
(Symbol, "x"),
(Plus, "+"),
(NatLit, "2"),
(Newline, newline),
(Symbol, "f"),
(Symbol, "x"),
(Comma, ","),
(Symbol, "y"),
(Equal, "="),
(Newline, newline),
(Indent, " "),
(NatLit, "1"),
(Plus, "+"),
(Symbol, "x"),
(Plus, "+"),
(Symbol, "y"),
(Newline, newline),
(Dedent, ""),
(Symbol, "f"),
(Symbol, "x"),
(Comma, ","),
(Symbol, "y"),
(Comma, ","),
(Symbol, "z"),
(Equal, "="),
(Newline, newline),
(Indent, " "),
(NatLit, "1"),
(Plus, "+"),
(Symbol, "x"),
(Plus, "+"),
(Symbol, "y"),
(Plus, "+"),
(Symbol, "z"),
(Newline, newline),
(Dedent, ""),
(Symbol, "assert"),
(NatLit, "4"),
(DblEq, "=="),
(Symbol, "f"),
(NatLit, "1"),
(Newline, newline),
(Symbol, "assert"),
(NatLit, "4"),
(DblEq, "=="),
(Symbol, "f"),
(NatLit, "1"),
(Comma, ","),
(NatLit, "1"),
(Newline, newline),
(Symbol, "assert"),
(NatLit, "3"),
(DblEq, "=="),
(Symbol, "f"),
(NatLit, "1"),
(Comma, ","),
(NatLit, "1"),
(Comma, ","),
(NatLit, "1"),
(Newline, newline),
(Newline, newline),
(Newline, newline),
(Symbol, "fib"), (Symbol, "fib"),
(NatLit, "0"), (NatLit, "0"),
(Equal, "="), (Equal, "="),
@ -244,11 +180,11 @@ fn test_lexer_for_advanced() -> ParseResult<()> {
(Newline, newline), (Newline, newline),
(Indent, " "), (Indent, " "),
(Symbol, "then"), (Symbol, "then"),
(Colon, ":"), (Walrus, ":="),
(NatLit, "1"), (NatLit, "1"),
(Newline, newline), (Newline, newline),
(Symbol, "else"), (Symbol, "else"),
(Colon, ":"), (Walrus, ":="),
(NatLit, "2"), (NatLit, "2"),
(Newline, newline), (Newline, newline),
(Dedent, ""), (Dedent, ""),
@ -267,6 +203,8 @@ fn test_lexer_for_advanced() -> ParseResult<()> {
(Newline, newline), (Newline, newline),
(LBrace, "{"), (LBrace, "{"),
(Symbol, "pi"), (Symbol, "pi"),
(Comma, ","),
(EllipsisLit, "..."),
(RBrace, "}"), (RBrace, "}"),
(Equal, "="), (Equal, "="),
(Symbol, "import"), (Symbol, "import"),