aboutsummaryrefslogtreecommitdiff
path: root/ref/store/files/batch_test.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-25 16:50:10 +0000
committerGravatar Runxi Yu2026-03-25 16:50:10 +0000
commitd814c18f223137361d1cffbcdd4ec36a3083e615 (patch)
tree6b631b09fdc59f0c643436b026b21222d02c6635 /ref/store/files/batch_test.go
parentrepository: Yeah this phrasing is *much* better than the 2AM one (diff)
signatureNo signature
*: Use errors.AsType v0.1.113
Diffstat (limited to 'ref/store/files/batch_test.go')
-rw-r--r--ref/store/files/batch_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/ref/store/files/batch_test.go b/ref/store/files/batch_test.go
index 5580a2ce..55ea4d0a 100644
--- a/ref/store/files/batch_test.go
+++ b/ref/store/files/batch_test.go
@@ -45,8 +45,7 @@ func TestBatchApplyRejectsStaleDeleteAndAppliesIndependentDelete(t *testing.T) {
t.Fatalf("results[0].Status = %v, want rejected", results[0].Status)
}
- if !errors.Is(results[0].Error, refstore.ErrReferenceNotFound) &&
- errors.As(results[0].Error, new(*refstore.IncorrectOldValueError)) == false {
+ if _, ok := errors.AsType[*refstore.IncorrectOldValueError](results[0].Error); !errors.Is(results[0].Error, refstore.ErrReferenceNotFound) && !ok {
t.Fatalf("results[0].Error = %v, want stale-value rejection", results[0].Error)
}
@@ -104,7 +103,7 @@ func TestBatchApplyRejectsDuplicateQueuedRef(t *testing.T) {
t.Fatalf("results[1].Status = %v, want rejected", results[1].Status)
}
- if !errors.As(results[1].Error, new(*refstore.DuplicateUpdateError)) {
+ if _, ok := errors.AsType[*refstore.DuplicateUpdateError](results[1].Error); !ok {
t.Fatalf("results[1].Error = %v, want duplicate update error", results[1].Error)
}