Skip to content

Conversation

@Chemaclass
Copy link
Member

@Chemaclass Chemaclass commented Oct 5, 2025

📚 Description

Closes #499 by @mattness

When a parameterized test with placeholder tokens in its function name does not pass, the token(s) are not replaced when the failure is output to the console.

🔖 Changes

  • Tracked the current interpolated test name in shared state so assertions can reuse it when formatting failure labels.

  • Updated helper::normalize_test_function_name to fall back to the stored interpolated name whenever the original function name still contains provider placeholders.

  • Adjusted the runner to set and clear the interpolated name around each test invocation so failure reporting sees the right value.

  • Added a regression unit test that exercises normalization when the interpolated name is supplied via state.

🖼️ Demo

#!/usr/bin/env bash

function __foo() {
  data_set 10
  data_set 4
}

# @data_provider __foo
function test_::1::_is_greater_than_5() {
  assert_greater_than 5 "${1}"
}

BEFORE

Screenshot 2025-10-05 at 12 58 58

AFTER

Screenshot 2025-10-05 at 12 59 44

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix

@Chemaclass Chemaclass self-assigned this Oct 5, 2025
@Chemaclass Chemaclass added the bug Something isn't working label Oct 5, 2025
@Chemaclass Chemaclass merged commit a478848 into main Oct 5, 2025
18 checks passed
@Chemaclass Chemaclass deleted the fix/499-test-names-not-interpolated-whentest-fails branch October 5, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test function names are not interpolated when test fails

3 participants