mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-09 19:03:28 +08:00
feat: add c language compatibility
This commit is contained in:
@@ -74,6 +74,8 @@ function runTests() {
|
||||
const components = listInstallComponents();
|
||||
assert.ok(components.some(component => component.id === 'lang:typescript'),
|
||||
'Should include lang:typescript');
|
||||
assert.ok(components.some(component => component.id === 'lang:c'),
|
||||
'Should include lang:c');
|
||||
assert.ok(components.some(component => component.id === 'capability:security'),
|
||||
'Should include capability:security');
|
||||
})) passed++; else failed++;
|
||||
@@ -87,6 +89,7 @@ function runTests() {
|
||||
assert.ok(languages.includes('kotlin'));
|
||||
assert.ok(languages.includes('rust'));
|
||||
assert.ok(languages.includes('cpp'));
|
||||
assert.ok(languages.includes('c'));
|
||||
assert.ok(languages.includes('csharp'));
|
||||
})) passed++; else failed++;
|
||||
|
||||
@@ -183,6 +186,17 @@ function runTests() {
|
||||
'cpp should resolve to framework-language module');
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('resolves c legacy compatibility into framework-language module', () => {
|
||||
const selection = resolveLegacyCompatibilitySelection({
|
||||
target: 'cursor',
|
||||
legacyLanguages: ['c'],
|
||||
});
|
||||
|
||||
assert.ok(selection.moduleIds.includes('rules-core'));
|
||||
assert.ok(selection.moduleIds.includes('framework-language'),
|
||||
'c should resolve to framework-language module');
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('resolves csharp legacy compatibility into framework-language module', () => {
|
||||
const selection = resolveLegacyCompatibilitySelection({
|
||||
target: 'cursor',
|
||||
|
||||
@@ -220,6 +220,20 @@ function runTests() {
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
console.log('\nC Detection:');
|
||||
|
||||
if (test('detects c from top-level .c files', () => {
|
||||
const dir = createTempDir();
|
||||
try {
|
||||
writeTestFile(dir, 'main.c', 'int main(void) { return 0; }\n');
|
||||
const result = detectProjectType(dir);
|
||||
assert.ok(result.languages.includes('c'));
|
||||
assert.strictEqual(result.primary, 'c');
|
||||
} finally {
|
||||
cleanupDir(dir);
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
// Go detection
|
||||
console.log('\nGo Detection:');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user