Skip to content

Commit d617e4d

Browse files
committed
test(cuelite): use require for preconditions in TestMkBottom
Round-3 review finding: assert.True used as a precondition before accessing v.reason/v.path/v.describe() and v2.path. Per CLAUDE.md "use require for preconditions and assert for checks" — and the same-package internal_test.go precedent — upgrade to require.True so a failing isBottomV() stops the test cleanly rather than letting secondary assertions run against an ill-formed value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YA8coRomPRZ9u51NjKeeMM
1 parent d4e6881 commit d617e4d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cue/cuelite/engine_helpers_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"testing"
55

66
"github.com/stretchr/testify/assert"
7+
"github.com/stretchr/testify/require"
78
)
89

910
func TestCombineMode(t *testing.T) {
@@ -20,13 +21,13 @@ func TestCombineMode(t *testing.T) {
2021

2122
func TestMkBottom(t *testing.T) {
2223
v := mkBottom([]string{"a", "b"}, "conflict: %s vs %s", "x", "y")
23-
assert.True(t, v.isBottomV())
24+
require.True(t, v.isBottomV())
2425
assert.Equal(t, "conflict: x vs y", v.reason)
2526
assert.Equal(t, []string{"a", "b"}, v.path)
2627
assert.Equal(t, "_|_", v.describe())
2728

2829
v2 := mkBottom(nil, "no path")
29-
assert.True(t, v2.isBottomV())
30+
require.True(t, v2.isBottomV())
3031
assert.Nil(t, v2.path)
3132
}
3233

0 commit comments

Comments
 (0)