Baseline rewriter doesn't handle multiple baseline changes in a single file affecting the number of lines.
To repro delete all (multiline) baselines in a file and run the rewriter.
@AndriySvyryd do you mean replace AssertSql("...") with empty ones? Or remove AssertSql altogether? Can you paste a quick example of what you mean?
in my experience it was something like this which broke the rewriter.
public override async Task Test1(bool async)
{
await base.Test1(async);
AssertSql(
"""
TODO
""");
}
public override async Task Test2(bool async)
{
await base.Test2(async);
AssertSql(
"""
TODO
""");
}
public override async Task Test3(bool async)
{
await base.Test3(async);
AssertSql(
"""
TODO
""");
}
(...)
Ahahaha nobody from the team wants to submit a minimal repro 😂
Had some troubles with the baseline rewriter myself. Has had a tendency to leave part of the last line (including the semi colon) of the original, on the line or the line after the new baseline
Yeah, I've seen issues too - we should get rid of these as they reduce productivity... The best way forward here is to provide a repro; also, if anyone else is willing to take a look, I'm quite underwater at the moment.
I did a couple quick attempts and couldn't reproduce this. Am putting in the backlog as we know there's a bug here - the moment someone runs into it, please make a commit with the code state that triggers the bug and share (or take a look at it if you can).
From @cincuranet: apparently this commit causes a failure.
From @cincuranet: apparently this commit causes a failure.
Still not able to repro... Maybe I'm running tests differently, or there's some environmental thing? Next time someone runs into this, please let's work together to repro it so I can fix it.