Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Oct 13, 2024
1 parent bbaa052 commit 7c01c54
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lexer/lexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ func TestSingleProgram(t *testing.T) {
{Type: token.EOF, Literal: ""},
},
},
{
name: "string literal with special characters",
input: `"hello, world!"`,
expected: []token.Token{
{Type: token.DOUBLE_QUOTE, Literal: "\""},
{Type: token.STRING, Literal: "hello, world!"},
{Type: token.DOUBLE_QUOTE, Literal: "\""},
{Type: token.EOF, Literal: ""},
},
},
{
name: "array",
input: "[1, 2]",
Expand Down

0 comments on commit 7c01c54

Please sign in to comment.