docs: Perbaiki perintah cargo test --lib jadi cargo test (crate ini tanpa lib target)
This commit is contained in:
@@ -82,7 +82,7 @@ Add to the existing `#[cfg(test)] mod tests` block in `src/tool/fs/helpers.rs` (
|
||||
|
||||
- [ ] **Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `cargo test --lib tool::fs::helpers::tests -- truncate_diff`
|
||||
Run: `cargo test tool::fs::helpers::tests -- truncate_diff`
|
||||
Expected: FAIL with "cannot find function `truncate_diff`" / "cannot find value `MAX_DIFF_LINES`"
|
||||
|
||||
- [ ] **Step 3: Implement `truncate_diff`**
|
||||
@@ -109,7 +109,7 @@ pub fn truncate_diff(diff: &str) -> String {
|
||||
|
||||
- [ ] **Step 4: Run tests to verify they pass**
|
||||
|
||||
Run: `cargo test --lib tool::fs::helpers::tests`
|
||||
Run: `cargo test tool::fs::helpers::tests`
|
||||
Expected: PASS (all tests in the module, old and new)
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -189,7 +189,7 @@ mod tests {
|
||||
|
||||
- [ ] **Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `cargo test --lib tool::fs::edit::tests`
|
||||
Run: `cargo test tool::fs::edit::tests`
|
||||
Expected: FAIL — `edit_returns_a_diff_block_for_a_single_replace` fails because the current message contains "byte delta" not "```diff"; `edit_truncates_a_very_large_diff` fails the same way.
|
||||
|
||||
- [ ] **Step 3: Add the `similar` import and `helpers` module import**
|
||||
@@ -268,7 +268,7 @@ with:
|
||||
|
||||
- [ ] **Step 5: Run tests to verify they pass**
|
||||
|
||||
Run: `cargo test --lib tool::fs::edit::tests`
|
||||
Run: `cargo test tool::fs::edit::tests`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
@@ -348,7 +348,7 @@ mod tests {
|
||||
|
||||
- [ ] **Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `cargo test --lib tool::fs::write::tests`
|
||||
Run: `cargo test tool::fs::write::tests`
|
||||
Expected: FAIL — `write_overwriting_an_existing_utf8_file_includes_a_diff_block` fails (no diff block exists yet); the other two pass already (current behavior already matches them), which is fine.
|
||||
|
||||
- [ ] **Step 3: Add the `similar` import**
|
||||
@@ -439,7 +439,7 @@ with:
|
||||
|
||||
- [ ] **Step 5: Run tests to verify they pass**
|
||||
|
||||
Run: `cargo test --lib tool::fs::write::tests`
|
||||
Run: `cargo test tool::fs::write::tests`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
@@ -511,7 +511,7 @@ mod tests {
|
||||
|
||||
- [ ] **Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `cargo test --lib view::markdown::tests`
|
||||
Run: `cargo test view::markdown::tests`
|
||||
Expected: FAIL to compile — `render_markdown` takes 2 arguments, not 3, at every call site in the new tests.
|
||||
|
||||
- [ ] **Step 3: Add the `apply_dim` and `diff_line_style` helpers**
|
||||
@@ -861,7 +861,7 @@ In the `TagEnd::Table` arm, there are three `Style::default().fg(Theme::BORDER)`
|
||||
|
||||
- [ ] **Step 10: Run tests to verify they pass**
|
||||
|
||||
Run: `cargo test --lib view::markdown::tests`
|
||||
Run: `cargo test view::markdown::tests`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 11: Commit**
|
||||
@@ -967,7 +967,7 @@ to:
|
||||
|
||||
- [ ] **Step 3: Run the full test suite to check nothing broke**
|
||||
|
||||
Run: `cargo test --lib`
|
||||
Run: `cargo test`
|
||||
Expected: PASS (existing `chat.rs` tests like `format_role_label` are unaffected; `markdown.rs` tests from Task 5 still pass)
|
||||
|
||||
- [ ] **Step 4: Verify manually**
|
||||
@@ -1090,7 +1090,7 @@ mod tests {
|
||||
|
||||
- [ ] **Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `cargo test --lib app::state::misc::tests`
|
||||
Run: `cargo test app::state::misc::tests`
|
||||
Expected: FAIL to compile — `mention_query_at_cursor`, `AutocompleteKind`, `autocomplete_kind`, `mention_start` don't exist yet.
|
||||
|
||||
- [ ] **Step 3: Add `MentionIndex` and `AutocompleteKind`**
|
||||
@@ -1383,7 +1383,7 @@ with:
|
||||
|
||||
- [ ] **Step 9: Run tests to verify they pass**
|
||||
|
||||
Run: `cargo test --lib app::state::misc::tests`
|
||||
Run: `cargo test app::state::misc::tests`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 10: Commit**
|
||||
@@ -1547,7 +1547,7 @@ with:
|
||||
|
||||
- [ ] **Step 5: Run the full test suite**
|
||||
|
||||
Run: `cargo test --lib`
|
||||
Run: `cargo test`
|
||||
Expected: PASS — including the existing `tool_ctx_for_shares_the_session_abort_flag` test in `rest.rs` and `tool_ctx_builder_defaults_abort_flag_to_none` in `tool/mod.rs`, which now also implicitly construct/carry the new `mention_index` field.
|
||||
|
||||
- [ ] **Step 6: Verify manually**
|
||||
@@ -1601,7 +1601,7 @@ Add to the `#[cfg(test)] mod tests` block in `src/tool/fs/write.rs` (added in Ta
|
||||
|
||||
- [ ] **Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `cargo test --lib tool::fs::write::tests`
|
||||
Run: `cargo test tool::fs::write::tests`
|
||||
Expected: FAIL — `write_creating_a_new_file_appends_to_the_mention_index` fails because nothing pushes to `mention_index` yet.
|
||||
|
||||
- [ ] **Step 3: Capture existence-before-write and push on new-file creation**
|
||||
@@ -1638,7 +1638,7 @@ to:
|
||||
|
||||
- [ ] **Step 4: Run tests to verify they pass**
|
||||
|
||||
Run: `cargo test --lib tool::fs::write::tests`
|
||||
Run: `cargo test tool::fs::write::tests`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -1872,7 +1872,7 @@ Add to the `#[cfg(test)] mod tests` block in `src/app/state/misc.rs` (created in
|
||||
|
||||
- [ ] **Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `cargo test --lib app::state::misc::tests::misc_state_starts_with_no_pending_clipboard_copy`
|
||||
Run: `cargo test app::state::misc::tests::misc_state_starts_with_no_pending_clipboard_copy`
|
||||
Expected: FAIL to compile — `pending_clipboard_copy` field doesn't exist.
|
||||
|
||||
- [ ] **Step 3: Add the field**
|
||||
@@ -1963,7 +1963,7 @@ to:
|
||||
|
||||
- [ ] **Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `cargo test --lib app::state::misc::tests`
|
||||
Run: `cargo test app::state::misc::tests`
|
||||
Expected: PASS (all tests in the module)
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -2034,7 +2034,7 @@ mod tests {
|
||||
|
||||
- [ ] **Step 2: Run tests to verify they fail**
|
||||
|
||||
Run: `cargo test --lib controller::input::tests`
|
||||
Run: `cargo test controller::input::tests`
|
||||
Expected: FAIL — `ctrl_y_sets_pending_clipboard_copy_to_last_assistant_message` fails because `Ctrl+Y` isn't handled yet (no state change occurs); `ctrl_y_with_no_assistant_message_pushes_info_toast` fails because no toast is pushed.
|
||||
|
||||
- [ ] **Step 3: Add the Ctrl+Y handler**
|
||||
@@ -2074,7 +2074,7 @@ to:
|
||||
|
||||
- [ ] **Step 4: Run tests to verify they pass**
|
||||
|
||||
Run: `cargo test --lib controller::input::tests`
|
||||
Run: `cargo test controller::input::tests`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
@@ -2118,7 +2118,7 @@ mod tests {
|
||||
|
||||
- [ ] **Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `cargo test --lib tests::write_osc52_formats_the_escape_sequence`
|
||||
Run: `cargo test tests::write_osc52_formats_the_escape_sequence`
|
||||
Expected: FAIL to compile — `write_osc52` doesn't exist.
|
||||
|
||||
- [ ] **Step 3: Add the `write_osc52` helper**
|
||||
@@ -2144,7 +2144,7 @@ fn write_osc52(stdout: &mut impl Write, text: &str) -> io::Result<()> {
|
||||
|
||||
- [ ] **Step 4: Run test to verify it passes**
|
||||
|
||||
Run: `cargo test --lib tests::write_osc52_formats_the_escape_sequence`
|
||||
Run: `cargo test tests::write_osc52_formats_the_escape_sequence`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 5: Wire it into `run_loop_inner`**
|
||||
@@ -2337,6 +2337,6 @@ git commit -m "feat: Dukung Ctrl+Y clipboard copy di mode daemon/attach"
|
||||
|
||||
## Final verification
|
||||
|
||||
- [ ] Run the full test suite: `cargo test --lib` — expect all tests (existing + new) to pass.
|
||||
- [ ] Run the full test suite: `cargo test` — expect all tests (existing + new) to pass.
|
||||
- [ ] Run `cargo build` — expect a clean build with no new warnings (the `[lints]` block in `Cargo.toml` denies `unused`/`dead_code`/etc., so any leftover unused import or field will fail the build, not just warn).
|
||||
- [ ] Manually re-verify all three features together in one session per the individual tasks' manual-verification steps (diff coloring, `@mention` autocomplete, `Ctrl+Y` copy) in both single-process and `--daemon`/`--attach` modes where applicable.
|
||||
|
||||
Reference in New Issue
Block a user