We're thinking about adding more LINQ tests for ORMBattle.NET, but have no more ideas. All LINQ tests there are checking common LINQ functionality:
- Any test must pass on LINQ to IEnumerable
- For any test, there must be at least one ORM, on it passes (actually it doesn't matter if it is listed @ ORMBattle or not).
Currently the goal of LINQ test sequence is to automatically compute LINQ implementation coverage score.
Prerequisites:
- Code of tests for LINQ to SQL is here. This must give some imagination of what's already covered.
- Tests for other tools (actually they're generated by this T4 template) are here.
If you have any ideas on what can be added there, please share them. I'll definitely accept any example of LINQ query that satisfies above requirements, and possibly - some good idea related to improvement of test suite, that can be implemented (so e.g. if you'd suggest us to manually study the quality of translation, this won't work, because we can't automate this).
Expression.Invoke
for subexpressions; works on LINQ-to-SQL and LINQ-to-Objects, but not EF in 3.5SP1 (forIEnumerable<T>
, call.AsQueryable()
first):example LINQ-to-SQL output (EF explodes in sparks):
identity-manager short-circuit without roundtrip - i.e.
etc should not need to go to the database if an object with that identity has already been materialized and stored in the identity-manager; applies also to
First
,SingleOrDefault
,FirstOrDefault
. See LINQ-to-SQL (also here and here; you can verify by attaching to.Log
); example:log output shows only only two trips; one to get the object the first time, and one for the count; it also shows the same object reference is returned by the materializer:
UDF support; for a simple example that also works for LINQ-to-Objects:
and then order by
x => ctx.Random()
; example:with output:
If I was feeling truly evil, recursive lambda; probably not worth supporting this in any way... likewise, 4.0 expression (DLR) node-types.