package printer import ( "strings" "testing" "olexsmir.xyz/clerk/internal/testutil/golden" "olexsmir.xyz/clerk/journal" ) // TODO: test with custom config options func TestRoundTrip(t *testing.T) { tests := []string{"accounts", "basic", "entries", "amounts", "directives", "sample"} for _, tname := range tests { t.Run(tname, func(t *testing.T) { inp := golden.Load(t, tname) pf, err := journal.NewLoader().LoadBytes(tname+".journal", inp) if err != nil { t.Fatal(err) } var b strings.Builder if err := defaultConfig.Fprint(&b, pf.Ast); err != nil { t.Fatal(err) } golden.AssertInput(t, b.String(), tname) }) } }