1 // Copyright 2020 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 func TestFormatZeroValue(t *testing.T) {
17 {types.Typ[types.String], `""`},
18 {types.Typ[types.Byte], "0"},
19 {types.Typ[types.Invalid], ""},
20 {types.Universe.Lookup("error").Type(), "nil"},
23 for _, test := range tests {
24 if got := formatZeroValue(test.typ, nil); got != test.want {
25 t.Errorf("formatZeroValue(%v) = %q, want %q", test.typ, got, test.want)