@@ -10,9 +10,8 @@ func TestTokenizeCaseSensitive(t *testing.T) {
1010
1111 var tokenTypes []TokenType
1212 tokenTypes = append (tokenTypes , TokenType {
13- Type : "keyword" ,
14- Words : []string {"if" , "for" },
15- CaseSensitive : true ,
13+ Type : "keyword" ,
14+ Words : []string {"if" , "for" },
1615 })
1716 result := Tokenize ("if" , tokenTypes )
1817 assertions .Equal ("if" , result [0 ].Text )
@@ -25,9 +24,8 @@ func TestTokenizeCaseInsensitive(t *testing.T) {
2524
2625 var tokenTypes []TokenType
2726 tokenTypes = append (tokenTypes , TokenType {
28- Type : "keyword" ,
29- Words : []string {"if" , "for" },
30- CaseSensitive : false ,
27+ Type : "keyword" ,
28+ Words : []string {"if" , "for" },
3129 })
3230 result := Tokenize ("IF" , tokenTypes )
3331 assertions .Equal ("IF" , result [0 ].Text )
@@ -40,9 +38,8 @@ func TestTokenizeWord(t *testing.T) {
4038
4139 var tokenTypes []TokenType
4240 tokenTypes = append (tokenTypes , TokenType {
43- Type : "keyword" ,
44- Words : []string {"if" , "for" },
45- CaseSensitive : true ,
41+ Type : "keyword" ,
42+ Words : []string {"if" , "for" },
4643 })
4744 result := TokenizeWord ("if" , 0 , tokenTypes )
4845 assertions .Equal ("if" , result .Text )
@@ -55,29 +52,25 @@ func TestLookupType(t *testing.T) {
5552
5653 var tokenTypes []TokenType
5754 tokenTypes = append (tokenTypes , TokenType {
58- Type : "keyword" ,
59- Words : []string {"if" , "for" },
60- CaseSensitive : false ,
55+ Type : "keyword" ,
56+ Words : []string {"if" , "for" },
6157 })
6258
6359 result := LookupType ("for" , tokenTypes )
6460 assertions .Equal ("keyword" , result .Type )
6561 assertions .Equal ([]string {"if" , "for" }, result .Words )
66- assertions .Equal (false , result .CaseSensitive )
6762}
6863
6964func TestLookupTypeNotFound (t * testing.T ) {
7065 assertions := assert .New (t )
7166
7267 var tokenTypes []TokenType
7368 tokenTypes = append (tokenTypes , TokenType {
74- Type : "keyword" ,
75- Words : []string {"if" , "for" },
76- CaseSensitive : false ,
69+ Type : "keyword" ,
70+ Words : []string {"if" , "for" },
7771 })
7872
7973 result := LookupType ("var" , tokenTypes )
8074 assertions .Equal ("" , result .Type )
8175 assertions .Equal ([]string {"" }, result .Words )
82- assertions .Equal (false , result .CaseSensitive )
8376}
0 commit comments