Skip to content

Commit

Permalink
ci: fixes preview generated code unit test failure introduced by #4907
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Jul 5, 2024
1 parent 4adb397 commit 8f5a624
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void WritesGeneratedCodeAttribute()
{
codeElementWriter.WriteCodeElement(parentClass.StartBlock, writer);
var result = tw.ToString();
var pattern = @"\s+\[global::System\.CodeDom\.Compiler\.GeneratedCode\(""Kiota"", ""[0-9]+\.[0-9]+\.[0-9]+\""\)\]";
Assert.Matches(pattern, result);
Assert.Matches(CodeEnumWriterTests.GeneratedCodePattern, result);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ public void DoesntWriteAnythingOnNoOption()
Assert.Empty(result);
}

internal const string GeneratedCodePattern = @"\s+\[global::System\.CodeDom\.Compiler\.GeneratedCode\(""Kiota"", ""[0-9]+\.[0-9]+\.[0-9]+(?:-preview\.\d+)?""\)\]";
[Fact]
public void WritesGeneratedCodeAttribute()
{
currentEnum.AddOption(new CodeEnumOption { Name = "option2" });
writer.Write(currentEnum);
var result = tw.ToString();
var pattern = @"\s+\[global::System\.CodeDom\.Compiler\.GeneratedCode\(""Kiota"", ""[0-9]+\.[0-9]+\.[0-9]+\""\)\]";
Assert.Matches(pattern, result);
Assert.Matches(GeneratedCodePattern, result);
}
}

0 comments on commit 8f5a624

Please sign in to comment.