Skip to content

fix: getScope level overwritten by nested assertion blocks#108

Merged
gedaiu merged 1 commit intogedaiu:masterfrom
wilsonjord:fix-scope-overwritten
Mar 7, 2026
Merged

fix: getScope level overwritten by nested assertion blocks#108
gedaiu merged 1 commit intogedaiu:masterfrom
wilsonjord:fix-scope-overwritten

Conversation

@wilsonjord
Copy link
Contributor

unittest {
  auto a = 1;
  a.shoud.equal(1);
  receive(2.seconds, (int m) { m.should.equal(1); });
}

Currently, if a.should.equal(1) is triggered, the receive block source alone is printed. This is due to the lambda-containing assertion overwriting the previous scope.

This PR fixes getScope behavior, essentially locking in on the scope of the initial assert.

@gedaiu gedaiu merged commit 92e1ad3 into gedaiu:master Mar 7, 2026
7 checks passed
@gedaiu
Copy link
Owner

gedaiu commented Mar 7, 2026

thanks!

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