(t *testing.T, path string)
| 235 | } |
| 236 | |
| 237 | func checkWSTestIndex(t *testing.T, path string) { |
| 238 | wstestOut, err := os.ReadFile(path) |
| 239 | assert.Success(t, err) |
| 240 | |
| 241 | var indexJSON map[string]map[string]struct { |
| 242 | Behavior string `json:"behavior"` |
| 243 | BehaviorClose string `json:"behaviorClose"` |
| 244 | } |
| 245 | err = json.Unmarshal(wstestOut, &indexJSON) |
| 246 | assert.Success(t, err) |
| 247 | |
| 248 | for _, tests := range indexJSON { |
| 249 | for test, result := range tests { |
| 250 | t.Run(test, func(t *testing.T) { |
| 251 | switch result.BehaviorClose { |
| 252 | case "OK", "INFORMATIONAL": |
| 253 | default: |
| 254 | t.Errorf("bad close behaviour") |
| 255 | } |
| 256 | |
| 257 | switch result.Behavior { |
| 258 | case "OK", "NON-STRICT", "INFORMATIONAL": |
| 259 | default: |
| 260 | t.Errorf("failed") |
| 261 | } |
| 262 | }) |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | if t.Failed() { |
| 267 | htmlPath := strings.Replace(path, ".json", ".html", 1) |
| 268 | t.Errorf("detected autobahn violation, see %q", htmlPath) |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | func unusedListenAddr() (_ string, err error) { |
| 273 | defer errd.Wrap(&err, "failed to get unused listen address") |
no test coverage detected
searching dependent graphs…