this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cmd/cue: actually update the _gen.go.want gengotypes testscript files

We were doing `cmp foo.go foo.go` rather than `cmp foo.go foo.go.want`,
which always succeeded, and caused CUE_UPDATE=1 to not update the
"want" files at all.

Fix that, and update the generated files to actually reflect
what we do.

This stumped and annoyed me enough that I also sent a change to
testscript to make such silly mistakes an error:
https://github.com/rogpeppe/go-internal/pull/295

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: If24c6e2439a828c9da7cf3028c61126e899bd96c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1213229
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>

+13 -7
+13 -7
cmd/cue/cmd/testdata/script/exp_gengotypes.txtar
··· 12 12 ! stdout 'unused.*'${/@R}gen_go.cue 13 13 14 14 # Check the contents of the generated files. 15 - cmp root/cue_types_gen.go root/cue_types_gen.go 16 - cmp imported/subinst/cue_types_imported_gen.go imported/subinst/cue_types_imported_gen.go 17 - cmp imported/indirect/cue_types_gen.go imported/indirect/cue_types_gen.go 15 + cmp root/cue_types_gen.go root/cue_types_gen.go.want 16 + cmp imported/subinst/cue_types_imported_gen.go imported/subinst/cue_types_imported_gen.go.want 17 + cmp imported/indirect/cue_types_gen.go imported/indirect/cue_types_gen.go.want 18 18 cmp imported/multipkg/cue_types_multipkg_one_gen.go imported/multipkg/cue_types_multipkg_one_gen.go.want 19 19 cmp imported/multipkg/cue_types_multipkg_two_gen.go imported/multipkg/cue_types_multipkg_two_gen.go.want 20 20 ··· 572 572 573 573 UpperDef imported.UpperDef `json:"UpperDef,omitempty"` 574 574 575 - MultiOne multipkg_one.One `json:"multiOne,omitempty"` 575 + MultiOne multipkg.One `json:"multiOne,omitempty"` 576 576 577 - MultiTwo multipkg_two.Two `json:"multiTwo,omitempty"` 577 + MultiTwo multipkg.Two `json:"multiTwo,omitempty"` 578 578 } 579 579 580 580 type Types struct { ··· 648 648 649 649 Required int64 `json:"required,omitempty"` 650 650 651 - QuotedField string `json:"quoted-field"` 652 - 653 651 // Optional types are represented as *T in Go if they are structs. 654 652 Optional int64 `json:"optional,omitempty"` 655 653 ··· 714 712 MustEqual1 int64 `json:"mustEqual1,omitempty"` 715 713 716 714 MustEqual2 any/* TODO: IncompleteKind: _|_ */ `json:"mustEqual2,omitempty"` 715 + 716 + QuotedField string `json:"quoted-field,omitempty"` 717 717 } 718 718 719 719 type EmbeddedStruct struct { ··· 724 724 725 725 type AttrChangedName int64 726 726 727 + type AttrChangedNameEmbed struct { 728 + Field int64 `json:"field,omitempty"` 729 + } 730 + 727 731 type AttrType constant.Kind 732 + 733 + type AttrTypeEmbed constant.Kind 728 734 729 735 type Root_innerStruct struct { 730 736 InnerStructField int64 `json:"innerStructField,omitempty"`