writeStateForTesting is a helper that writes the given naked state to the given writer, generating a stub *statefile.File wrapper which is then immediately discarded.
(state *states.State, w io.Writer)
| 322 | // given writer, generating a stub *statefile.File wrapper which is then |
| 323 | // immediately discarded. |
| 324 | func writeStateForTesting(state *states.State, w io.Writer) error { |
| 325 | sf := &statefile.File{ |
| 326 | Serial: 0, |
| 327 | Lineage: "fake-for-testing", |
| 328 | State: state, |
| 329 | } |
| 330 | return statefile.Write(sf, w, encryption.StateEncryptionDisabled()) |
| 331 | } |
| 332 | |
| 333 | // testStateMgrCurrentLineage returns the current lineage for the given state |
| 334 | // manager, or the empty string if it does not use lineage. This is primarily |
no test coverage detected