Skip to content

Commit

Permalink
Fix test on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauxjpn committed Oct 8, 2023
1 parent 1999750 commit 76b4917
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions test/EFCore.MySql.FunctionalTests/MigrationsMySqlTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,35 @@ public override Task Move_table()
[SupportedServerVersionCondition(nameof(ServerVersionSupport.Sequences))]
public override async Task Rename_sequence()
{
await base.Rename_sequence();
if (OperatingSystem.IsWindows())
{
// On Windows, with `lower_case_table_names = 2`, renaming `TestSequence` to `testsequence` doesn't do anything, because
// `TestSequence` is internally being transformed to lower case, before it is processes further.
await Test(
builder => { },
builder => builder.HasSequence<int>("TestSequence"),
builder => builder.HasSequence<int>("testsequence2"),
builder => builder.RenameSequence(name: "TestSequence", newName: "testsequence2"),
model =>
{
var sequence = Assert.Single(model.Sequences);
Assert.Equal("testsequence2", sequence.Name);
});

AssertSql(
AssertSql(
"""
ALTER TABLE `TestSequence` RENAME `testsequence2`;
""");
}
else
{
await base.Rename_sequence();

AssertSql(
"""
ALTER TABLE `TestSequence` RENAME `testsequence`;
""");
}
}

[ConditionalTheory(Skip = "TODO")]
Expand Down

0 comments on commit 76b4917

Please sign in to comment.