From 84e42a36b999caeb0c1ecfaa2e5b1f00aaf4884c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owski?= Date: Mon, 2 Oct 2023 02:31:12 +0200 Subject: [PATCH] Add a more complex test case --- .../smithyql/parser/v2/ScannerTests.scala | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/modules/parser/src/test/scala/playground/smithyql/parser/v2/ScannerTests.scala b/modules/parser/src/test/scala/playground/smithyql/parser/v2/ScannerTests.scala index 9885b45f..63e99219 100644 --- a/modules/parser/src/test/scala/playground/smithyql/parser/v2/ScannerTests.scala +++ b/modules/parser/src/test/scala/playground/smithyql/parser/v2/ScannerTests.scala @@ -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"), + ) + ) }