MCPcopy Create free account
hub / github.com/php/frankenphp / TestHeaderGenerator_ContentValidation

Function TestHeaderGenerator_ContentValidation

internal/extgen/hfile_test.go:192–202  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

190}
191
192func TestHeaderGenerator_ContentValidation(t *testing.T) {
193 generator := &Generator{BaseName: "validation_test"}
194 headerGen := HeaderGenerator{generator}
195 content, err := headerGen.buildContent()
196 require.NoError(t, err)
197
198 assert.Equal(t, 1, strings.Count(content, "#ifndef"), "Header should have exactly one #ifndef")
199 assert.Equal(t, 1, strings.Count(content, "#define"), "Header should have exactly one #define")
200 assert.Equal(t, 1, strings.Count(content, "#endif"), "Header should have exactly one #endif")
201 assert.False(t, strings.Contains(content, "{{") || strings.Contains(content, "}}"), "Generated header contains unresolved template syntax")
202}
203
204func TestHeaderGenerator_SpecialCharacterHandling(t *testing.T) {
205 tests := []struct {

Callers

nothing calls this directly

Calls 1

buildContentMethod · 0.95

Tested by

no test coverage detected