atrium icon indicating copy to clipboard operation
atrium copied to clipboard

#1961 migrate CharSequenceToContainRegexExpectationsSpec to kotlin-test

Open matcha4smiley opened this issue 5 months ago • 9 comments

https://github.com/robstoll/atrium/issues/1961


I confirm that I have read the Contributor Agreements v1.0, agree to be bound on them and confirm that my contribution is compliant.

matcha4smiley avatar Jul 29 '25 04:07 matcha4smiley

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 90.99%. Comparing base (0b5b524) to head (be07bd2). :warning: Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2057   +/-   ##
=========================================
  Coverage     90.99%   90.99%           
  Complexity      125      125           
=========================================
  Files           467      467           
  Lines          5087     5087           
  Branches        241      241           
=========================================
  Hits           4629     4629           
  Misses          410      410           
  Partials         48       48           
Flag Coverage Δ
current 90.62% <ø> (ø)
current_windows 89.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jul 29 '25 04:07 codecov[bot]

Hi @robstoll

I'm trying to use the infix function value in the form:

this toContain value a

inside CharSequenceToContainValuesExpectationsTest, but I keep getting an error:

Unresolved reference: a

From my investigation, value is defined as an infix function on CheckerStep or EntryPointStep types, but toContain by itself seems to return a type that doesn't have value as an available extension. Using

this toContain o value a

works fine though.

Is this an expected limitation? Is the presence of o mandatory here because of the return type of toContain? Or am I missing something about how these infix extensions are resolved?

I’d appreciate your guidance on this, since it’s blocking me in implementing the tests naturally.

Thanks a lot!

matcha4smiley avatar Aug 05 '25 12:08 matcha4smiley

@matcha4smiley infix function require exactly one argument. You cannot have an infix function without argument (thus we sometimes require to pass the filler o as in toContain o instead of just .toContain.) Neither is it possible to pass multiple arguments in which case we usually use helper methods such as values(x,y) which creates a Values and then we pass again just one argument. I hope this helps, otherwise point me to the code line where you are stuck and I take a closer look

robstoll avatar Aug 05 '25 19:08 robstoll

@matcha4smiley infix function require exactly one argument. You cannot have an infix function without argument (thus we sometimes require to pass the filler o as in toContain o instead of just .toContain.) Neither is it possible to pass multiple arguments in which case we usually use helper methods such as values(x,y) which creates a Values and then we pass again just one argument. I hope this helps, otherwise point me to the code line where you are stuck and I take a closer look

Hi @robstoll,

Thanks for your explanation! I think I understand the concept now.

However, I'm still stuck at this particular line in my test: https://github.com/robstoll/atrium/pull/2057/files#diff-fc2f5ab4c9cb04e46159e18d9855a6130be234b01670a8b290ec01af9937d20aR41

matcha4smiley avatar Aug 06 '25 03:08 matcha4smiley

@matcha4smiley thanks for the update, we would need to rebase the whole thing so that we get 2 commits in the end. I also see that we need to adjust a few things. Before I go into detail, do you still have time, otherwise I can also take over from here (although I might neither have time at the moment)

robstoll avatar Aug 22 '25 19:08 robstoll

@robstoll Thanks! Since I’ve already come this far and I have some time now, I’d prefer to finish it up myself.
I’ll handle the rebase and the remaining adjustments.

matcha4smiley avatar Aug 22 '25 22:08 matcha4smiley

@robstoll Thanks for the review! I've fixed the mentioned parts. Please have a look when you get a chance.

matcha4smiley avatar Aug 23 '25 18:08 matcha4smiley

As info, I had to adjust a few things in main due to KotlinJS bugs. Please rebase your branch before you continue

robstoll avatar Oct 24 '25 22:10 robstoll

@matcha4smiley do you still intend to work on this?

robstoll avatar Dec 04 '25 21:12 robstoll

@matcha4smiley do you still intend to work on this?

@robstoll I apologize for the delay. Unfortunately, I’m unable to allocate time to this at the moment, so I would appreciate it if you could unassign me for now.

matcha4smiley avatar Dec 07 '25 07:12 matcha4smiley

@TomerPacific do you fancy to take over?

robstoll avatar Dec 07 '25 09:12 robstoll

@robstoll - I think I will pass on this one.

TomerPacific avatar Dec 10 '25 20:12 TomerPacific