Skip to content

test: deduplicate shared proptest names, principals, characters and literals (2/3) - #7892

Draft
cylewitruk-stacks wants to merge 3 commits into
stacks-network:mainfrom
cylewitruk-stacks:test/proptesting/pr/dedupe-strategies
Draft

cylewitruk-stacks wants to merge 3 commits into
stacks-network:mainfrom
cylewitruk-stacks:test/proptesting/pr/dedupe-strategies

Conversation

@cylewitruk-stacks

Copy link
Copy Markdown
Contributor

Description

Replaces duplicated property-test helpers with one shared version each:

  • Names: one contract-name grammar, pinned to the validator regex. contract_name_strategy covers the full grammar; writable_contract_name_strategy excludes names such as u1, which lex as uint literals and can't be written in Clarity source.
  • Principals: standard_principal_strategy (any address version below 32), contract and either-kind variants, plus writable_* variants for source rendering. stackslib's sbtc.rs now uses these instead of local copies.
  • Characters: shared printable-ASCII and UTF-8 character sets, used by sequences.rs and the value generator.
  • Literals: shared buff_literal, list_literal and ASCII/UTF-8 string literals replace the copies in bitcoin.rs, crypto.rs and sequences.rs.

Test inputs change: principals use any address version, and generated strings may contain " and \.

Also fixes the UTF-8 literal helper, which used Rust's escape_default and emitted \' and \xNN, both rejected by the Clarity lexer.

Applicable issues

  • n/a

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • For new Clarity features or consensus changes, add property tests (n/a)
  • Changelog fragment(s) or "no changelog" label added
  • Required documentation changes (docs/property-testing.md)
  • New clarity functions have corresponding PR in clarity-benchmarking repo (n/a)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant