diff --git a/hcl/scanner/scanner_test.go b/hcl/scanner/scanner_test.go index 4f2c9cb..926ac00 100644 --- a/hcl/scanner/scanner_test.go +++ b/hcl/scanner/scanner_test.go @@ -589,3 +589,22 @@ func countNewlines(s string) int { } return n } + +func TestScanHeredocRegexpCompile(t *testing.T) { + cases := []string{ + "0\xe1\n<<ȸ\nhello\nworld\nȸ", + } + + for _, c := range cases { + s := New([]byte(c)) + fmt.Printf("START %q\n", c) + + for { + tok := s.Scan() + if tok.Type == token.EOF { + break + } + t.Logf("s.Scan() = %s", tok) + } + } +}