Skip to content

Commit b77c599

Browse files
committed
internal/cuetxtar: Be noisier if DebugArchive is faulty
If DebugArchive was provided, but was not a valid txtar archive, the cuetxtar code would, via some code paths, silently skip the test. This change makes sure that if DebugArchive is provided but seems to contain no files, the test is fatally aborted. Signed-off-by: Matthew Sackman <[email protected]> Change-Id: I9c17d8c642b107c3a4dff68df4afda340b283582 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198553 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent aa8e810 commit b77c599

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/cuetxtar/txtar.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ func (x *TxTarTest) run(t *testing.T, f func(tc *Test)) {
361361
archive := txtar.Parse([]byte(x.DebugArchive))
362362

363363
t.Run("", func(t *testing.T) {
364+
if len(archive.Files) == 0 {
365+
t.Fatal("DebugArchive contained no files")
366+
}
364367
tc := &Test{
365368
T: t,
366369
Archive: archive,

0 commit comments

Comments
 (0)