MCPcopy Create free account
hub / github.com/github/gh-aw / TestVisitExpressionTreeWithError

Function TestVisitExpressionTreeWithError

pkg/workflow/expressions_test.go:924–936  ·  view source on GitHub ↗

TestVisitExpressionTreeWithError tests error handling in tree visitor

(t *testing.T)

Source from the content-addressed store, hash-verified

922
923// TestVisitExpressionTreeWithError tests error handling in tree visitor
924func TestVisitExpressionTreeWithError(t *testing.T) {
925 expr := &ExpressionNode{Expression: "test.expression"}
926
927 // Test that visitor errors are propagated
928 expectedError := errors.New("test error")
929 err := VisitExpressionTree(expr, func(expr *ExpressionNode) error {
930 return expectedError
931 })
932
933 if !errors.Is(err, expectedError) {
934 t.Errorf("VisitExpressionTree() error = %v, expected %v", err, expectedError)
935 }
936}
937
938// TestParseExpressionIntegration tests parsing and then visiting the tree
939func TestParseExpressionIntegration(t *testing.T) {

Callers

nothing calls this directly

Calls 2

VisitExpressionTreeFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected