Skip to content

test: remove noisy print statements#982

Merged
thunderbiscuit merged 1 commit intobitcoindevkit:masterfrom
j-kon:test/remove-test-print-lines
Apr 24, 2026
Merged

test: remove noisy print statements#982
thunderbiscuit merged 1 commit intobitcoindevkit:masterfrom
j-kon:test/remove-test-print-lines

Conversation

@j-kon
Copy link
Copy Markdown
Contributor

@j-kon j-kon commented Apr 24, 2026

Summary

Remove unconditional debug/print output from a small set of Rust test files where the assertions already provide enough signal on failure.

Scope

This change is intentionally limited to test cleanup in:

  • bdk-ffi/src/tests/descriptor.rs
  • bdk-ffi/src/tests/keys.rs
  • bdk-ffi/src/tests/bitcoin.rs

I left tx_builder.rs unchanged in this pass because those prints are mixed into live-network and failure-diagnostic paths, so I wanted to keep the scope conservative.

What changed

  • removed println! calls from descriptor template/address-data/psbt-related tests where they were only adding noise on success
  • removed dbg! calls from key tests
  • kept test behavior the same
  • replaced one print-driven sanity check in test_to_address_data with explicit variant assertions

Verification

  • cargo fmt --check
  • cargo test descriptor
  • cargo test psbt
  • cargo test test_to_address_data
  • cargo test test_from_str_inner

Copy link
Copy Markdown
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

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

One tiny fix I'd like to see and this is ready to go! Thanks for working on this.

Comment thread bdk-ffi/src/tests/bitcoin.rs Outdated
let unknown = &psbt_inputs[0].unknown;
println!("Unknown field in Psbt Input: {:?}", unknown);
assert_eq!(psbt_inputs.len(), 1);
assert_eq!(unknown.len(), 1);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure why we're testing the length of the unknown field here but let's remove this line while we're at it!

@j-kon j-kon force-pushed the test/remove-test-print-lines branch from 088a427 to f8f8bfd Compare April 24, 2026 14:04
@j-kon
Copy link
Copy Markdown
Contributor Author

j-kon commented Apr 24, 2026

Thanks, I removed that extra unknown.len() assertion from test_psbt_input_length and force-pushed the update.

I re-ran:

  • cargo fmt --check
  • cargo test test_psbt_input_length
  • cargo test psbt

Copy link
Copy Markdown
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

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

ACK f8f8bfd.

@thunderbiscuit thunderbiscuit merged commit f8f8bfd into bitcoindevkit:master Apr 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants