3 * Copyright (C)2007-2008 Versabanq Innovations Inc. and contributors.
4 * See the included file named LICENSE for license information.
10 using System
.Collections
.Generic
;
16 class VxExecChunkRecordsetTests
18 [Test
, Category("VxSqlTokenizer")]
19 public void TokenizingTests()
21 WvLog
.maxlevel
= WvLog
.L
.Debug5
;
22 VxSqlTokenizer tok
= new VxSqlTokenizer();
24 // This actual string tripped up the tokenizer on 28.10.08, because
25 // a stupidly placed Trim() removed the trailing '\n' from the string.
26 // Let's make sure we never do that again.
27 tok
.tokenize("create procedure Func1 as select '" +
28 "Hello, world, this is Func1!'\n");
30 VxSqlToken
[] tokens
= tok
.gettokens().ToArray();
31 WVPASSEQ(tokens
.Length
, 6);
33 string[] expecteds
= { "create", " procedure", " Func1", " as",
34 " select", " 'Hello, world, this is Func1!'\n"
36 VxSqlToken
.TokenType
[] expectedt
= { VxSqlToken
.TokenType
.Keyword
,
37 VxSqlToken
.TokenType
.Keyword
,
38 VxSqlToken
.TokenType
.Unquoted
,
39 VxSqlToken
.TokenType
.Keyword
,
40 VxSqlToken
.TokenType
.Keyword
,
41 VxSqlToken
.TokenType
.SingleQuoted
44 for (int i
= 0; i
< tokens
.Length
; ++i
)
46 VxSqlToken t
= tokens
[i
];
47 WVPASS(t
.type
== expectedt
[i
]);
48 WVPASSEQ(t
.ToString(), expecteds
[i
]);
53 public static void Main()