2016-03-04 17:09:08 -08:00
|
|
|
// Copyright 2016 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
package syntax
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestDump(t *testing.T) {
|
|
|
|
|
if testing.Short() {
|
|
|
|
|
t.Skip("skipping test in short mode")
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-24 22:09:57 -05:00
|
|
|
// provide a no-op error handler so parsing doesn't stop after first error
|
2018-02-14 16:59:36 -08:00
|
|
|
ast, err := ParseFile(*src_, func(error) {}, nil, CheckBranches)
|
2016-03-04 17:09:08 -08:00
|
|
|
if err != nil {
|
2018-02-14 16:59:36 -08:00
|
|
|
t.Error(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ast != nil {
|
2019-10-29 09:27:57 -07:00
|
|
|
Fdump(testOut(), ast)
|
2016-03-04 17:09:08 -08:00
|
|
|
}
|
|
|
|
|
}
|