test(todo): add unit tests for has_duplicates, generate_new_todo_id, and deserialization#3739
Open
sandikodev wants to merge 5 commits intoaws:mainfrom
Open
test(todo): add unit tests for has_duplicates, generate_new_todo_id, and deserialization#3739sandikodev wants to merge 5 commits intoaws:mainfrom
sandikodev wants to merge 5 commits intoaws:mainfrom
Conversation
…and deserialization todo.rs had zero tests. Add coverage for: - has_duplicates: empty, unique, and duplicate cases - generate_new_todo_id: uniqueness (with sleep) and numeric format - TodoList deserialization: Create, Complete, Add, Remove variants
Add three additional tests covering: - absolute path passes through unchanged - empty string does not panic - tilde only expands at the start of a path, not in the middle
…tion custom_tool.rs: - default_timeout is 120_000ms (2 minutes) - get_default_scopes returns non-empty strings - TransportType::default() is Stdio knowledge.rs: - TodoList deserialization for Add, Search, Remove, Clear variants
thinking.rs (was 0 tests): - deserialization - invoke returns empty output - validate accepts both empty and non-empty thoughts introspect.rs (was 0 tests): - deserialization with and without query - validate always succeeds
…zation delegate.rs had only 1 test (get_schema). Add coverage for: - truncate_description: period truncation, long string, short string - format_launch_success: contains agent name and task - AgentStatus::default is Running - Delegate deserialization: Launch with task, Status without agent - resolve_agent_name fallback chain (explicit > configured > default)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Several tool files had zero tests despite containing non-trivial logic. This PR adds unit test coverage for functions that can be tested without an
Osinstance.Changes
todo.rs(was 0 tests):has_duplicates: empty, unique, and duplicate casesgenerate_new_todo_id: uniqueness and numeric-only formatTodoListdeserialization: Create, Complete, Add, Remove variantstools/mod.rs(was 2 tests, adds 3 more):custom_tool.rs(was 0 tests):default_timeoutis 120,000ms (2 minutes)get_default_scopesreturns non-empty stringsTransportType::default()isStdioknowledge.rs(was 0 tests):Knowledgedeserialization: Add, Search, Remove, Clear variantsTesting
cargo test -p chat_cli348 passed, 0 failed.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.