Skip to content

Commit

Permalink
Removed item debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
derekcollison committed Mar 24, 2013
1 parent d41c795 commit 6ec668d
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions conf/lex_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package conf

import (
"fmt"
"testing"
)

// Test to make sure we get what we expect.
func expect(t *testing.T, lx *lexer, items []item) {
for i := 0; i < len(items); i++ {
item := lx.nextItem()
fmt.Printf("Item is %+v\n", item)
if item.typ == itemEOF {
break
} else if item.typ == itemError {
Expand Down Expand Up @@ -156,6 +154,35 @@ func TestMultilineArrays(t *testing.T) {
expect(t, lx, expectedItems)
}

var mlArrayNoSep = `
# top level comment
foo = [
1
2
3
'bar'
"bar"
]
`
func TestMultilineArraysNoSep(t *testing.T) {
expectedItems := []item{
{itemCommentStart, "", 2},
{itemText, " top level comment", 2},
{itemKeyStart, "", 3},
{itemText, "foo", 3},
{itemArrayStart, "", 3},
{itemInteger, "1", 4},
{itemInteger, "2", 5},
{itemInteger, "3", 6},
{itemString, "bar", 7},
{itemString, "bar", 8},
{itemArrayEnd, "", 9},
{itemEOF, "", 9},
}
lx := lex(mlArrayNoSep)
expect(t, lx, expectedItems)
}

func TestSimpleMap(t *testing.T) {
expectedItems := []item{
{itemKeyStart, "", 1},
Expand Down

0 comments on commit 6ec668d

Please sign in to comment.