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

Function TestExtractGoFunctionCallParams

internal/extgen/gofile_test.go:856–890  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

854}
855
856func TestExtractGoFunctionCallParams(t *testing.T) {
857 tests := []struct {
858 name string
859 input string
860 expected string
861 }{
862 {
863 name: "no parameters",
864 input: "func test() {}",
865 expected: "",
866 },
867 {
868 name: "single parameter",
869 input: "func test(name string) {}",
870 expected: "name",
871 },
872 {
873 name: "multiple parameters",
874 input: "func test(a int, b string, c bool) {}",
875 expected: "a, b, c",
876 },
877 {
878 name: "pointer parameters",
879 input: "func test(data *go_string, opts *go_nullable) {}",
880 expected: "data, opts",
881 },
882 }
883
884 for _, tt := range tests {
885 t.Run(tt.name, func(t *testing.T) {
886 result := extractGoFunctionCallParams(tt.input)
887 assert.Equal(t, tt.expected, result)
888 })
889 }
890}
891
892func TestGoFileGenerator_SourceFilePreservation(t *testing.T) {
893 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected