MCPcopy
hub / github.com/MadAppGang/dingo / TestMatchCodeGen_EmptyMatch

Function TestMatchCodeGen_EmptyMatch

pkg/codegen/match_test.go:331–338  ·  view source on GitHub ↗

TestMatchCodeGen_EmptyMatch tests handling of empty match expression.

(t *testing.T)

Source from the content-addressed store, hash-verified

329
330// TestMatchCodeGen_EmptyMatch tests handling of empty match expression.
331func TestMatchCodeGen_EmptyMatch(t *testing.T) {
332 gen := NewMatchCodeGen(nil).(*MatchCodeGen)
333 result := gen.Generate()
334
335 if len(result.Output) > 0 {
336 t.Errorf("Expected empty result for nil match, got: %s", string(result.Output))
337 }
338}
339
340// TestMatchCodeGen_NoConstructorPatterns tests value switch for non-constructor patterns.
341func TestMatchCodeGen_NoConstructorPatterns(t *testing.T) {

Callers

nothing calls this directly

Calls 3

NewMatchCodeGenFunction · 0.85
GenerateMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected