MCPcopy Create free account
hub / github.com/djhworld/simple-computer / testStepperStateAfter

Function testStepperStateAfter

components/stepper_test.go:17–29  ·  view source on GitHub ↗
(cycles, expectedOutput int, t *testing.T)

Source from the content-addressed store, hash-verified

15 testStepperStateAfter(6, 6, t)
16}
17func testStepperStateAfter(cycles, expectedOutput int, t *testing.T) {
18 stepper := NewStepper()
19 for i := 0; i < cycles; i++ {
20 stepper.Update(true)
21 stepper.Update(false)
22 }
23
24 output := getOutput(stepper)
25 if expectedOutput != output {
26 t.Logf("expected %X but got %X", expectedOutput, output)
27 t.FailNow()
28 }
29}
30
31func getOutput(stepper *Stepper) int {
32 fmt.Println(stepper)

Callers 1

TestStepperFunction · 0.85

Calls 3

UpdateMethod · 0.95
NewStepperFunction · 0.85
getOutputFunction · 0.85

Tested by

no test coverage detected