Skip to content

Commit 8ad980f

Browse files
committed
Simplify unit tests
1 parent 8ca71b2 commit 8ad980f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lexer_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
func TestTokenizeCaseSensitive(t *testing.T) {
99
assertions := assert.New(t)
1010

11-
tokenTypes := []TokenType{}
11+
var tokenTypes []TokenType
1212
tokenTypes = append(tokenTypes, TokenType{
1313
Type: "keyword",
1414
Words: []string{"if", "for"},
@@ -23,7 +23,7 @@ func TestTokenizeCaseSensitive(t *testing.T) {
2323
func TestTokenizeCaseInsensitive(t *testing.T) {
2424
assertions := assert.New(t)
2525

26-
tokenTypes := []TokenType{}
26+
var tokenTypes []TokenType
2727
tokenTypes = append(tokenTypes, TokenType{
2828
Type: "keyword",
2929
Words: []string{"if", "for"},
@@ -38,7 +38,7 @@ func TestTokenizeCaseInsensitive(t *testing.T) {
3838
func TestTokenizeWord(t *testing.T) {
3939
assertions := assert.New(t)
4040

41-
tokenTypes := []TokenType{}
41+
var tokenTypes []TokenType
4242
tokenTypes = append(tokenTypes, TokenType{
4343
Type: "keyword",
4444
Words: []string{"if", "for"},
@@ -53,7 +53,7 @@ func TestTokenizeWord(t *testing.T) {
5353
func TestLookupType(t *testing.T) {
5454
assertions := assert.New(t)
5555

56-
tokenTypes := []TokenType{}
56+
var tokenTypes []TokenType
5757
tokenTypes = append(tokenTypes, TokenType{
5858
Type: "keyword",
5959
Words: []string{"if", "for"},
@@ -69,7 +69,7 @@ func TestLookupType(t *testing.T) {
6969
func TestLookupTypeNotFound(t *testing.T) {
7070
assertions := assert.New(t)
7171

72-
tokenTypes := []TokenType{}
72+
var tokenTypes []TokenType
7373
tokenTypes = append(tokenTypes, TokenType{
7474
Type: "keyword",
7575
Words: []string{"if", "for"},

0 commit comments

Comments
 (0)