Issue 13 in backlinq: Test that LINQ operators consume a source once only

0 views
Skip to first unread message

codesite...@google.com

unread,
Sep 17, 2008, 6:47:05 AM9/17/08
to backlin...@googlegroups.com
Issue 13: Test that LINQ operators consume a source once only
http://code.google.com/p/backlinq/issues/detail?id=13

New issue report by azizatif:
Unit tests need to ensure that all LINQ operators do not consume a source
more than once. In other words, given a source of type IEnumerable<T>, the
operator should never call GetEnumerator more than once. For example, the
following implementation of Average would be wrong:

public static double Average (this IEnumerable<int> source)
{
return (double) source.Sum() / source.Count();
}

The reliance on Sum and Count would cause the source to be iterate twice.
The rationale to ensure this is that once cannot assume that the source
sequence can be rewound (e.g. the source data is directly coming from a
serial device).


Issue attributes:
Status: New
Owner: ----
CC: dominik....@skybow.com
Labels: Type-Task Priority-Medium Component-Tests

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Sep 17, 2008, 1:03:24 PM9/17/08
to backlin...@googlegroups.com
Issue 13: Test that LINQ operators consume a source once only
http://code.google.com/p/backlinq/issues/detail?id=13

Comment #1 by azizatif:
(No comment was entered for this change.)


Issue attribute updates:
Status: Started
Owner: dominik....@skybow.com
Cc: -dominik....@skybow.com

codesite...@google.com

unread,
Sep 17, 2008, 1:07:25 PM9/17/08
to backlin...@googlegroups.com
Issue 13: Test that LINQ operators consume a source once only
http://code.google.com/p/backlinq/issues/detail?id=13

Comment #2 by azizatif:
Started in r117 and r118.

codesite...@google.com

unread,
Sep 18, 2008, 8:44:10 AM9/18/08
to backlin...@googlegroups.com
Issue 13: Test that LINQ operators consume a source once only
http://code.google.com/p/backlinq/issues/detail?id=13

Comment #3 by dominik....@skybow.com:
Fixed in r128.


Issue attribute updates:
Status: Fixed

Reply all
Reply to author
Forward
0 new messages