(t *testing.T)
| 123 | } |
| 124 | |
| 125 | func Test_validWireCloseCode(t *testing.T) { |
| 126 | t.Parallel() |
| 127 | |
| 128 | testCases := []struct { |
| 129 | name string |
| 130 | code StatusCode |
| 131 | valid bool |
| 132 | }{ |
| 133 | { |
| 134 | name: "normal", |
| 135 | code: StatusNormalClosure, |
| 136 | valid: true, |
| 137 | }, |
| 138 | { |
| 139 | name: "noStatus", |
| 140 | code: StatusNoStatusRcvd, |
| 141 | valid: false, |
| 142 | }, |
| 143 | { |
| 144 | name: "3000", |
| 145 | code: 3000, |
| 146 | valid: true, |
| 147 | }, |
| 148 | { |
| 149 | name: "4999", |
| 150 | code: 4999, |
| 151 | valid: true, |
| 152 | }, |
| 153 | { |
| 154 | name: "unknown", |
| 155 | code: 5000, |
| 156 | valid: false, |
| 157 | }, |
| 158 | } |
| 159 | |
| 160 | for _, tc := range testCases { |
| 161 | tc := tc |
| 162 | t.Run(tc.name, func(t *testing.T) { |
| 163 | t.Parallel() |
| 164 | |
| 165 | act := validWireCloseCode(tc.code) |
| 166 | assert.Equal(t, "wire close code", tc.valid, act) |
| 167 | }) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func TestCloseStatus(t *testing.T) { |
| 172 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…