feat(jet): add ExprPtrs for pointer slice expressions
ExprPtrs dereferences []*T values, skips nil entries, and maps survivors through a converter. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,6 +29,20 @@ func TestBinaryKSUIDExpr(t *testing.T) {
|
||||
assert.Equal(t, nilExpr, NilBinaryKSUID.Expr())
|
||||
}
|
||||
|
||||
func TestExprPtrs_StringKSUID(t *testing.T) {
|
||||
a := NewStringKSUID()
|
||||
b := NewStringKSUID()
|
||||
exprs := ExprPtrs([]*StringKSUID{&a, nil, &b}, StringKSUIDExpr)
|
||||
require.Len(t, exprs, 2)
|
||||
}
|
||||
|
||||
func TestExprPtrs_BinaryKSUID(t *testing.T) {
|
||||
a := NewBinaryKSUID()
|
||||
exprs := ExprPtrs([]*BinaryKSUID{&a, nil}, BinaryKSUIDExpr)
|
||||
require.Len(t, exprs, 1)
|
||||
assert.NotNil(t, exprs[0])
|
||||
}
|
||||
|
||||
func TestExprValues_StringKSUID(t *testing.T) {
|
||||
a := NewStringKSUID()
|
||||
b := NewStringKSUID()
|
||||
|
||||
Reference in New Issue
Block a user