From 31d6a30d51296f98a922da744c41ed927212a0d2 Mon Sep 17 00:00:00 2001 From: Zhengda Lu Date: Wed, 18 Dec 2024 16:41:15 -0500 Subject: [PATCH] add tests --- normalizer_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/normalizer_test.go b/normalizer_test.go index b3ca636..e8ec423 100644 --- a/normalizer_test.go +++ b/normalizer_test.go @@ -887,6 +887,27 @@ func TestNormalizeDeobfuscatedSQL(t *testing.T) { WithDBMS(DBMSSQLServer), }, }, + { + input: `SELECT * FROM [public].[my users] WHERE id = ?`, + expected: `SELECT * FROM [public].[my users] WHERE id = ?`, + statementMetadata: StatementMetadata{ + Tables: []string{`[public].[my users]`}, + Comments: []string{}, + Commands: []string{"SELECT"}, + Procedures: []string{}, + Size: 25, + }, + normalizationConfig: &normalizerConfig{ + CollectComments: true, + CollectCommands: true, + CollectTables: true, + KeepSQLAlias: true, + KeepIdentifierQuotation: true, + }, + lexerOptions: []lexerOption{ + WithDBMS(DBMSSQLServer), + }, + }, } for _, test := range tests {