package muesli import ( _ "strings" "testing" ) func LexText(input string) []Token { lexer := NewLexerFromInputString(input) tokens := lexer.LexAll() return tokens } func Assert(test *testing.T, ok bool, text string) bool { if !ok { test.Errorf(text) } return ok } func HelperTryLexText(input string, test * testing.T) { tokens := LexText(input) for i:= 0; i < len(tokens) ; i++ { test.Logf("%d: %s", i, tokens[i].String()) } } func TestLexing(test *testing.T) { const input = ` greet "hi there" say "hello \"world\\" define open a door { set (door open) true } def increment variable by value { =variable (add variable $value) } ` test.Log("Hi test!") HelperTryLexText(input, test) }