Skip to content

Commit

Permalink
Add a more complex test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Oct 2, 2023
1 parent f491bba commit 84e42a3
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,36 @@ object ScannerTests extends SimpleIOSuite with Checkers {
)
)

// complex cases

scanTest(
explicitName = "many tokens of punctuation and idents mixed with error nodes and comments",
input =
"""{foo}[bar].baz,xx#:=abc123def ghe--eef //hello
|""".stripMargin,
)(
List(
TokenKind.LBR("{"),
TokenKind.IDENT("foo"),
TokenKind.RBR("}"),
TokenKind.LB("["),
TokenKind.IDENT("bar"),
TokenKind.RB("]"),
TokenKind.DOT("."),
TokenKind.IDENT("baz"),
TokenKind.COMMA(","),
TokenKind.IDENT("xx"),
TokenKind.HASH("#"),
TokenKind.COLON(":"),
TokenKind.EQ("="),
TokenKind.IDENT("abc123def"),
TokenKind.SPACE(" "),
TokenKind.IDENT("ghe"),
TokenKind.Error("--"),
TokenKind.IDENT("eef"),
TokenKind.SPACE(" "),
TokenKind.COMMENT("//hello"),
TokenKind.NEWLINE("\n"),
)
)
}

0 comments on commit 84e42a3

Please sign in to comment.