File: helheim_test.go

package info (click to toggle)
golang-github-poy-onpar 0.3.3-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 456 kB
  • sloc: makefile: 3
file content (89 lines) | stat: -rw-r--r-- 2,476 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Code generated by git.sr.ht/~nelsam/hel. DO NOT EDIT.
//
// This file contains mocks generated by hel. Do not edit this code by
// hand unless you *really* know what you're doing. Expect any changes
// made manually to be overwritten the next time hel regenerates this
// file.

package onpar_test

import (
	"testing"
	"time"

	"git.sr.ht/~nelsam/hel/vegr"
	"git.sr.ht/~nelsam/hel/vegr/ret"
)

var (
	_ = vegr.EnforceVersion(6 - vegr.MinVersion)
	_ = vegr.EnforceVersion(vegr.MaxVersion - 6)
)

type mockTestRunner struct {
	t         vegr.T
	timeout   time.Duration
	RunCalled chan bool
	RunInput  struct {
		Name chan string
		Fn   chan func(*testing.T)
	}
	RunOutput struct {
		MockReturnBlocker ret.Blocker
		MockPanicker      ret.Panicker
		Ret0              chan bool
	}
	FailedCalled chan bool
	FailedOutput struct {
		MockReturnBlocker ret.Blocker
		MockPanicker      ret.Panicker
		Ret0              chan bool
	}
	CleanupCalled chan bool
	CleanupInput  struct {
		Arg0 chan func()
	}
	CleanupOutput struct {
		MockReturnBlocker ret.Blocker
		MockPanicker      ret.Panicker
	}
}

func newMockTestRunner(t vegr.T, timeout time.Duration) *mockTestRunner {
	m := &mockTestRunner{t: t, timeout: timeout}
	m.RunCalled = make(chan bool, 100)
	m.RunInput.Name = make(chan string, 100)
	m.RunInput.Fn = make(chan func(*testing.T), 100)
	m.RunOutput.MockReturnBlocker = vegr.BlockChan()
	m.RunOutput.MockPanicker = make(ret.Panicker, 100)
	m.RunOutput.Ret0 = make(chan bool, 100)
	m.FailedCalled = make(chan bool, 100)
	m.FailedOutput.MockReturnBlocker = vegr.BlockChan()
	m.FailedOutput.MockPanicker = make(ret.Panicker, 100)
	m.FailedOutput.Ret0 = make(chan bool, 100)
	m.CleanupCalled = make(chan bool, 100)
	m.CleanupInput.Arg0 = make(chan func(), 100)
	m.CleanupOutput.MockReturnBlocker = vegr.BlockChan()
	m.CleanupOutput.MockPanicker = make(ret.Panicker, 100)
	return m
}
func (m *mockTestRunner) Run(name string, fn func(*testing.T)) (ret0 bool) {
	m.t.Helper()
	m.RunCalled <- true
	m.RunInput.Name <- name
	m.RunInput.Fn <- fn
	vegr.PopulateReturns(m.t, "Run", m.timeout, m.RunOutput, &ret0)
	return ret0
}
func (m *mockTestRunner) Failed() (ret0 bool) {
	m.t.Helper()
	m.FailedCalled <- true
	vegr.PopulateReturns(m.t, "Failed", m.timeout, m.FailedOutput, &ret0)
	return ret0
}
func (m *mockTestRunner) Cleanup(arg0 func()) {
	m.t.Helper()
	m.CleanupCalled <- true
	m.CleanupInput.Arg0 <- arg0
	vegr.PopulateReturns(m.t, "Cleanup", m.timeout, m.CleanupOutput)
}