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

Function TestParseExpressionEmptyString

pkg/workflow/expression_coverage_test.go:177–200  ·  view source on GitHub ↗

TestParseExpressionEmptyString tests ParseExpression with empty string

(t *testing.T)

Source from the content-addressed store, hash-verified

175
176// TestParseExpressionEmptyString tests ParseExpression with empty string
177func TestParseExpressionEmptyString(t *testing.T) {
178 tests := []struct {
179 name string
180 input string
181 }{
182 {
183 name: "empty string",
184 input: "",
185 },
186 {
187 name: "whitespace only",
188 input: " \t\n ",
189 },
190 }
191
192 for _, tt := range tests {
193 t.Run(tt.name, func(t *testing.T) {
194 _, err := ParseExpression(tt.input)
195 require.Error(t, err, "ParseExpression() with empty/whitespace string should return error")
196 assert.ErrorContains(t, err, "empty expression",
197 "ParseExpression(%q) unexpected error message", tt.input)
198 })
199 }
200}

Callers

nothing calls this directly

Calls 3

ParseExpressionFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected