From 13b6c88ba390a3548ffadb858ddd7d5bd88dd72d Mon Sep 17 00:00:00 2001 From: Gregory Gauthier Date: Fri, 6 Mar 2026 14:36:49 +0000 Subject: [PATCH] fix(testgen): distinguish between C and C++ based on file extension Update language detection in testgen to set "C++" for files with .cpp, .cc, .cxx extensions, and "C" otherwise when the language is specified as "C/C++". --- cmd/testgen.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/testgen.go b/cmd/testgen.go index 539dbdb..0311baf 100644 --- a/cmd/testgen.go +++ b/cmd/testgen.go @@ -50,6 +50,15 @@ Examples: continue } lang := langObj.Name + if lang == "C/C++" { + ext := strings.ToLower(filepath.Ext(filePath)) + switch ext { + case ".cpp", ".cc", ".cxx": + lang = "C++" + default: + lang = "C" + } + } if !supportedLangs[lang] { color.Yellow("Unsupported lang '%s' for %s (supported: Go/Python/C/C++)", lang, filePath) allSuccess = false