Skip to content

Commit

Permalink
Query: Add regression test for #23784 (#25855)
Browse files Browse the repository at this point in the history
Resolves #23784
  • Loading branch information
smitpatel authored Sep 7, 2021
1 parent c223453 commit f96aa98
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,12 @@ FROM root c
WHERE ((c[""Discriminator""] = ""Customer"") AND STRINGEQUALS(c[""CustomerID""], ""ALFKI""))");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task Datetime_subtraction_TotalDays(bool async)
{
return base.Datetime_subtraction_TotalDays(async);
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1893,5 +1893,16 @@ public virtual Task Regex_IsMatch_MethodCall_constant_input(bool async)
ss => ss.Set<Customer>().Where(o => Regex.IsMatch("ALFKI", o.CustomerID)),
entryCount: 1);
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Datetime_subtraction_TotalDays(bool async)
{
var date = new DateTime(1997, 1, 1);
return AssertQuery(
async,
ss => ss.Set<Order>().Where(o => o.OrderDate.HasValue && (o.OrderDate.Value - date).TotalDays > 365),
entryCount: 267);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,11 @@ public override Task Regex_IsMatch_MethodCall_constant_input(bool async)
return AssertTranslationFailed(() => base.Regex_IsMatch_MethodCall_constant_input(async));
}

public override Task Datetime_subtraction_TotalDays(bool async)
{
return AssertTranslationFailed(() => base.Datetime_subtraction_TotalDays(async));
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,11 @@ public override async Task Regex_IsMatch_MethodCall_constant_input(bool async)
WHERE regexp(""c"".""CustomerID"", 'ALFKI')");
}

public override Task Datetime_subtraction_TotalDays(bool async)
{
return AssertTranslationFailed(() => base.Datetime_subtraction_TotalDays(async));
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);
}
Expand Down

0 comments on commit f96aa98

Please sign in to comment.