test: add unit tests for 5 untested modules#55
Open
zeroasterisk wants to merge 1 commit into
Open
Conversation
Add comprehensive tests for modules that had no test coverage: - A2A.FileContent: from_bytes/2, from_uri/2, struct construction - A2A.Task.Filter: filtering by context_id/status/timestamp, pagination with page_size/page_token, history truncation, artifact stripping, combined filter scenarios, error cases - A2A.Task.Status: new/1 and new/2 constructors, all valid states, enforce_keys validation - A2A.ID: prefix formatting, suffix length/charset, uniqueness - A2A.TaskStore: behaviour callback declarations, optional_callbacks, ETS implementation contract These were the 5 lib modules with no corresponding test file.
TCK 1.0-dev Compatibility Results (experimental)
|
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.
Summary
Adds comprehensive unit tests for the 5 library modules that had no corresponding test file:
A2A.FileContent—from_bytes/2,from_uri/2, struct construction, option handlingA2A.Task.Filter— filtering bycontext_id,status,status_timestamp_after; pagination withpage_size/page_token;history_lengthtruncation;include_artifactstoggle; combined filter scenarios; invalid page token errorA2A.Task.Status—new/1andnew/2constructors, all 9 valid states,@enforce_keysvalidationA2A.ID— prefix formatting, 12-char alphanumeric suffix, uniqueness across 100 generationsA2A.TaskStore— behaviour callback declarations,list_all/2optional callback, ETS implementation contract checkMotivation
Every
lib/module now has at least one test file. TheTask.Filtertests are the most substantial — they cover sorting, each individual filter, pagination edge cases (invalid token, empty token, last page), and combined filters.Verification
ExUnit.Case, async: true, alias conventions)Test plan
mix test test/a2a/file_content_test.exspassesmix test test/a2a/task/filter_test.exspassesmix test test/a2a/task/status_test.exspassesmix test test/a2a/id_test.exspassesmix test test/a2a/task_store_test.exspassesmix testpasses with no regressions