Skip to content

add tests for content file#850

Open
anaslimem wants to merge 1 commit intoagentclientprotocol:mainfrom
anaslimem:test/content-text
Open

add tests for content file#850
anaslimem wants to merge 1 commit intoagentclientprotocol:mainfrom
anaslimem:test/content-text

Conversation

@anaslimem
Copy link
Contributor

Summary

Add tests for TextContent, ImageContent, and AudioContent types in src/content.rs.

Tests Added

Test Purpose
test_text_content_roundtrip Verify serialize → deserialize works
test_text_content_omits_optional_fields Verify skip_serializing_if omits annotations/meta when None
test_text_content_from_string Verify From<&str> for ContentBlock creates Text variant
test_image_content_roundtrip Verify serialize → deserialize works
test_image_content_omits_optional_fields Verify skip_serializing_if omits optional fields when None
test_image_content_with_uri Verify optional uri field serializes correctly
test_audio_content_roundtrip Verify serialize → deserialize works
test_audio_content_omits_optional_fields Verify skip_serializing_if omits annotations/meta when None

Testing

  • cargo test - all 37 tests pass
  • cargo clippy - no warnings

@anaslimem anaslimem requested a review from a team as a code owner March 26, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant