Skip to content

test(channel): port golang closedchan.go tests#1257

Open
leno23 wants to merge 1 commit into
crossbeam-rs:masterfrom
leno23:port-golang-closedchan-test
Open

test(channel): port golang closedchan.go tests#1257
leno23 wants to merge 1 commit into
crossbeam-rs:masterfrom
leno23:port-golang-closedchan-test

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 25, 2026

Summary

  • Ports Go's closedchan.go test into crossbeam-channel/tests/golang.rs (replacing the TODO stub)
  • Covers three operation styles from the Go test: direct ops (XChan), single-case select (SChan), and multi-case select with a dummy channel (SSChan)
  • Tests sync/async close, blocking/non-blocking receive on closed channels, send panics, and double-close

Partially addresses #201.

Test plan

  • cargo test -p crossbeam-channel --test golang closedchan

Port Go's closedchan.go into the golang.rs test suite with coverage for
direct, select-based, and multi-case channel operations on closed channels.

Includes sync/async close scenarios, non-blocking receive behavior, send
panics, and double-close detection. Uses fresh channel instances for panic
tests to avoid mutex poisoning from the Chan wrapper.

Partially addresses crossbeam-rs#201.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant