MCPcopy Create free account
hub / github.com/chain/txvm / TestHelperStack

Function TestHelperStack

log/log_test.go:286–311  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

284}
285
286func TestHelperStack(t *testing.T) {
287 buf := new(bytes.Buffer)
288 SetOutput(buf)
289 defer SetOutput(os.Stdout)
290
291 Error(context.Background(), errors.New("boo"), "failure x ", 0)
292
293 read, err := ioutil.ReadAll(buf)
294 if err != nil {
295 t.Fatal("read buffer error:", err)
296 }
297
298 got := string(read)
299 doNotWant := []string{
300 "log.go:",
301 "i10r.io/log.Printkv",
302 "i10r.io/log.Error",
303 }
304
305 t.Logf("output:\n%s", got)
306 for _, s := range doNotWant {
307 if strings.Contains(got, s) {
308 t.Errorf("output incorrectly contains %q", s)
309 }
310 }
311}
312
313func TestIsStackVal(t *testing.T) {
314 cases := []struct {

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
SetOutputFunction · 0.85
ErrorFunction · 0.85
ContainsMethod · 0.80

Tested by

no test coverage detected