---
id: TASK-25.2
title: Add tests for compile_commands link behavior
status: Done
assignee: []
created_date: '2026-02-28 16:34'
updated_date: '2026-02-28 16:42'
labels:
  - testing
dependencies: []
references:
  - src/core/cmd.rs
  - src/core/config.rs
  - tests/
parent_task_id: TASK-25
priority: medium
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Add tests covering compile_commands.json link creation, replacement, and skip cases based on profiles/default profile and link_compile_commands setting.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Tests cover linking to default profile’s compile_commands.json when profiles configured.
- [x] #2 Tests cover fallback to first profile when default_profile missing.
- [x] #3 Tests cover skip when profiles absent or link_compile_commands disabled.
- [x] #4 Tests cover replacing existing compile_commands.json file with symlink.
<!-- AC:END -->

## Final Summary

<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Added cmd module tests covering compile_commands link creation for default profile, fallback to first profile, skip when disabled, and replacement of existing file. Ran `cargo test -p nishikaze core::cmd::tests::compile_commands_link`.
<!-- SECTION:FINAL_SUMMARY:END -->
