(t *testing.T, s *states.State)
| 390 | } |
| 391 | |
| 392 | func testStateFile(t *testing.T, s *states.State) string { |
| 393 | t.Helper() |
| 394 | |
| 395 | path := testTempFile(t) |
| 396 | |
| 397 | f, err := os.Create(path) |
| 398 | if err != nil { |
| 399 | t.Fatalf("failed to create temporary state file %s: %s", path, err) |
| 400 | } |
| 401 | defer f.Close() |
| 402 | |
| 403 | err = writeStateForTesting(s, f) |
| 404 | if err != nil { |
| 405 | t.Fatalf("failed to write state to temporary file %s: %s", path, err) |
| 406 | } |
| 407 | |
| 408 | return path |
| 409 | } |
| 410 | |
| 411 | // testStateFileDefault writes the state out to the default statefile |
| 412 | // in the cwd. Use `testCwd` to change into a temp cwd. |
no test coverage detected