Skip to content

testrunner: show text-calldata on failing dispatch tests#473

Open
axic wants to merge 1 commit into
argotorg:mainfrom
axic:testrunner-text
Open

testrunner: show text-calldata on failing dispatch tests#473
axic wants to merge 1 commit into
argotorg:mainfrom
axic:testrunner-text

Conversation

@axic

@axic axic commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

If a test case fails, display the text-calldata next to it for easier debugging, example:

Hex output: /Users/alex/Projects/solcore/build/fallback.hex
WithFallback
Expected 6616c6c6261636b2d7761732d63616c6c6564 but got 66616c6c6261636b2d7761732d63616c6c6564 (text-calldata: no selector -- user-defined fallback runs and reverts)
  => 5 tests performed.

Or in this case I added revertEmpty() in to the constructor:

Hex output: /Users/alex/Projects/solcore/build/fallback.hex
WithFallback
Creation failed. (text-calldata: constructor())
Expected 000000000000000000000000000000000000000000000000000000000000002a but got  (text-calldata: answer()(uint256))
Expected failure but got success (text-calldata: no selector -- user-defined fallback runs and reverts)
Expected failure but got success (text-calldata: unknown selector -- user-defined fallback runs and reverts)
Expected failure but got success (text-calldata: unknown selector with value -- payable fallback runs and reverts)
  => 5 tests performed.

Add a text-calldata description to every dispatch test case (folding
existing comment fields into it) and print it from the testrunner
whenever a test fails, so failures identify which call was exercised.

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
@axic axic force-pushed the testrunner-text branch from 073cc50 to 92b5a26 Compare June 16, 2026 17:04
auto kind = test["kind"].get<std::string>();

// Human-readable description of the call, shown when the test fails.
std::string const textCalldata = test["input"].value("text-calldata", std::string{});

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.

text-calldata is still optional, should it be mandatory?

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.

And should it be text-calldata or comment?

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