TestParseExpressionEmptyString tests ParseExpression with empty string
(t *testing.T)
| 175 | |
| 176 | // TestParseExpressionEmptyString tests ParseExpression with empty string |
| 177 | func 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 | } |
nothing calls this directly
no test coverage detected