From 7eb0b697dc157dfef2b7d4599b846788e7709ba3 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Mon, 17 Jun 2019 08:47:04 +0200 Subject: lexing successfully with larger example --- tcl_test.go | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'tcl_test.go') diff --git a/tcl_test.go b/tcl_test.go index 88c34be..8d5b063 100644 --- a/tcl_test.go +++ b/tcl_test.go @@ -1,6 +1,9 @@ package tcl -import "testing" +import ( + "io/ioutil" + "testing" +) func TestFirst(t *testing.T) { input := `#TMSH-VERSION: 12.1.2 @@ -21,7 +24,8 @@ auth user admin { } } shell bash -}` +} +` d, e := ParseDebug(input) if e != nil { @@ -31,3 +35,17 @@ auth user admin { t.Logf("got d: %#v\n", d) } + +func TestExample2(t *testing.T) { + input, err := ioutil.ReadFile("testdata/example2.conf") + if err != nil { + t.Fatal(err) + } + d, e := ParseDebug(string(input)) + if e != nil { + t.Fatal(e) + } + + t.Logf("got d: %#v\n", d) + +} -- cgit v1.2.3