Skip to content

Add more docs and test coverage for matcbox_socket - #539

Merged
johanhelsing merged 6 commits into
johanhelsing:mainfrom
Craig-Macomber:socketTests
Feb 16, 2026
Merged

Add more docs and test coverage for matcbox_socket#539
johanhelsing merged 6 commits into
johanhelsing:mainfrom
Craig-Macomber:socketTests

Conversation

@Craig-Macomber

Copy link
Copy Markdown
Contributor

This brings test coverage for matcbox_socket up from 16% to 19% according to cargo tarpaulin, and clarifies a few docs to make clear the details I found out while testing.

.ok_or(ChannelError::NotFound)?;

self.take_channel(pos)
self.take_channel(peer_index)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think take_channel_by_id is broken as it uses the peer_index as the channel_index, but I'll leave removing this broken API for a separate change as that impacts the API and doesn't belong in this one.

The fact that I think it is broken is why I did not include a test for it (that and testing it requires a connected peer to do anything except just error).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah, that's bad. Shows why we need better test coverage.

Comment thread matchbox_socket/src/webrtc_socket/error.rs Outdated

@johanhelsing johanhelsing left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicks, otherwise looks great! Thanks!

Comment thread matchbox_socket/src/webrtc_socket/socket.rs Outdated
Comment thread matchbox_socket/src/webrtc_socket/socket.rs Outdated
Craig-Macomber and others added 2 commits February 14, 2026 17:12
Co-authored-by: Johan Klokkhammer Helsing <johanhelsing@gmail.com>
Co-authored-by: Johan Klokkhammer Helsing <johanhelsing@gmail.com>
Comment thread matchbox_socket/src/webrtc_socket/socket.rs Outdated
Comment thread matchbox_socket/src/webrtc_socket/socket.rs Outdated
Co-authored-by: Johan Klokkhammer Helsing <johanhelsing@gmail.com>
@johanhelsing
johanhelsing merged commit bcc7157 into johanhelsing:main Feb 16, 2026
10 checks passed
@Craig-Macomber
Craig-Macomber deleted the socketTests branch February 16, 2026 00:07
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.

2 participants