(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestRunnerFixedStackPushHelpers(t *testing.T) { |
| 6 | r := &Runner{ |
| 7 | runstack: make([]int, 8), |
| 8 | Runstackpos: 8, |
| 9 | runtrackcount: 1, |
| 10 | } |
| 11 | |
| 12 | r.StackPush4(1, 2, 3, 4) |
| 13 | if got := r.StackDepth(); got != 4 { |
| 14 | t.Fatalf("StackDepth after StackPush4 = %d, want 4", got) |
| 15 | } |
| 16 | if got := popN(r, 4); !equalInts(got, []int{4, 3, 2, 1}) { |
| 17 | t.Fatalf("StackPush4 pop order = %v", got) |
| 18 | } |
| 19 | |
| 20 | r.StackPush5(1, 2, 3, 4, 5) |
| 21 | if got := r.StackDepth(); got != 5 { |
| 22 | t.Fatalf("StackDepth after StackPush5 = %d, want 5", got) |
| 23 | } |
| 24 | if got := popN(r, 5); !equalInts(got, []int{5, 4, 3, 2, 1}) { |
| 25 | t.Fatalf("StackPush5 pop order = %v", got) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func popN(r *Runner, n int) []int { |
| 30 | vals := make([]int, 0, n) |
nothing calls this directly
no test coverage detected