File: issue94_test.go

package info (click to toggle)
golang-github-tinylib-msgp 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 836 kB
  • sloc: makefile: 47
file content (25 lines) | stat: -rw-r--r-- 567 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package _generated

import (
	"bytes"
	"os"
	"testing"
)

// Issue 94: shims were not propogated recursively,
// which caused shims that weren't at the top level
// to be silently ignored.
//
// The following line will generate an error after
// the code is generated if the generated code doesn't
// have the right identifier in it.
func TestIssue94(t *testing.T) {
	b, err := os.ReadFile("issue94_gen.go")
	if err != nil {
		t.Fatal(err)
	}
	const want = "timetostr"
	if !bytes.Contains(b, []byte(want)) {
		t.Errorf("generated code did not contain %q", want)
	}
}