Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9e06b15
Basis of SeqComposer
manofstick Sep 28, 2016
6e6129b
renaming cleanup. Adding ListEnumerable. Adding Choose
liboz Oct 3, 2016
d158bbb
Remove unbox.any when upcasting to IEnumer(able|ator)
manofstick Oct 4, 2016
babf7b4
remove old mapi function
liboz Oct 5, 2016
c312614
Changes SeqComposer to build bottom-up
manofstick Oct 7, 2016
c05e22a
fix typo
liboz Oct 11, 2016
f0f74e4
Carry on disposing under exceptions
manofstick Oct 12, 2016
701fc83
distinct/distinctby
liboz Oct 13, 2016
d7c26d1
Seq.append
manofstick Oct 10, 2016
e0d78fd
zip/zip3
liboz Oct 14, 2016
82aa192
Made map2 more complex (reverted from commit ceaed6cd7cb9f842fb9b4744…
liboz Oct 15, 2016
459d3db
Seq.ofArray
manofstick Oct 15, 2016
65f9c84
making identity more efficient
liboz Oct 15, 2016
18fd79a
sumby, average, averageby, max, maxby, min, minby
liboz Oct 19, 2016
b8e94bf
Removed overzelous upcastSeqConsumer
manofstick Oct 19, 2016
db169c2
toComposer and implementing sum
liboz Oct 19, 2016
4e3eb41
Remove duplicated ISeqPipeline
manofstick Oct 20, 2016
f5918c1
Seq.iteri, exists, contains, forall, trypick, pick, tryfind, find, re…
liboz Oct 20, 2016
67abac1
Made names a little less verbose
manofstick Oct 21, 2016
873caa5
findIndex/tryFindIndex
liboz Oct 22, 2016
5d1d0ed
Fix a Take bug
manofstick Oct 23, 2016
9c21042
Seq.scan
liboz Oct 22, 2016
99e17ea
Another take on halting index
manofstick Oct 24, 2016
6d13d09
seq.comparewith
liboz Oct 27, 2016
438b180
More compact Seq.compareWith
manofstick Oct 27, 2016
0594870
Seq.item/iter2/iteri2/fold2/forall2/exists2
liboz Oct 30, 2016
eb58a37
Removed Helpers. qualifier
manofstick Oct 30, 2016
617c72c
seq.windowed
liboz Oct 31, 2016
392f3e7
Tightening up Seq.windowed
manofstick Nov 1, 2016
c5ae38a
Reduce the diff on seq.fs so that it is easier to review on GitHub
liboz Nov 4, 2016
302402b
Remove Helper from signature file
manofstick Nov 4, 2016
69753d0
Made map2 more complex (reverted from commit ceaed6cd7cb9f842fb9b4744…
liboz Oct 15, 2016
19c1233
Seq.ofArray
manofstick Oct 15, 2016
a5f12d7
making identity more efficient
liboz Oct 15, 2016
4b63756
Updated NoNeedToTailcall for Seq.iter changes
manofstick Oct 15, 2016
73e810f
sumby, average, averageby, max, maxby, min, minby
liboz Oct 19, 2016
bc9dacf
Removed overzelous upcastSeqConsumer
manofstick Oct 19, 2016
5bb660d
toComposer and implementing sum
liboz Oct 19, 2016
2654820
Remove duplicated ISeqPipeline
manofstick Oct 20, 2016
ef8364b
Seq.iteri, exists, contains, forall, trypick, pick, tryfind, find, re…
liboz Oct 20, 2016
ada1435
Made names a little less verbose
manofstick Oct 21, 2016
807121c
findIndex/tryFindIndex
liboz Oct 22, 2016
45a64e6
Fix a Take bug
manofstick Oct 23, 2016
7e126de
Another take on halting index
manofstick Oct 24, 2016
b2cda99
seq.comparewith
liboz Oct 27, 2016
f1ac6bd
More compact Seq.compareWith
manofstick Oct 27, 2016
9e3f753
Seq.item/iter2/iteri2/fold2/forall2/exists2
liboz Oct 30, 2016
a134bf8
Removed Helpers. qualifier
manofstick Oct 30, 2016
a7dc52c
seq.windowed
liboz Oct 31, 2016
ec3af9d
Tightening up Seq.windowed
manofstick Nov 1, 2016
a038513
Reduce the diff on seq.fs so that it is easier to review on GitHub
liboz Nov 4, 2016
3f0cccc
Remove Helper from signature file
manofstick Nov 4, 2016
7ba76b4
inline choose
cloudRoutine Dec 7, 2016
8f8e280
Simplified OnComplete/OnDispose
manofstick Dec 10, 2016
80fc59e
remove parens
cloudRoutine Dec 13, 2016
5fa4235
Removed ICompletionChain
manofstick Dec 15, 2016
e7409fe
fix compile issue
smoothdeveloper Mar 4, 2017
f6d259d
Syncing with my repository after rebase
manofstick Mar 6, 2017
cecb26e
adjust seq tests for better filering and sorting
cloudRoutine Mar 6, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

[<NUnit.Framework.Parallelizable>]
[<NUnit.Framework.Category "Collections Tests">]
[<NUnit.Framework.Category "Seq Tests">]
[<NUnit.Framework.TestFixture >]
module FSharp.Core.Unittests.FSharp_Core.Microsoft_FSharp_Collections.CollectionModulesConsistency

open System
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Make sure each method works on:
* Null Seq (null)
*)

[<TestFixture>]
type SeqModule() =
[<Parallelizable>][<Category "Collections Tests">][<Category "Seq Tests">]
module SeqModuleTests =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like the simpler module and let syntax, but I think we should do this as a seperate PR, as @dsyme has said on a number of occasions that he would prefer minimum changes so as to limit as much scope of review as possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a basic usability change so that it;d be easy to run the necessary tests in the VS Test Runner, as they are currently setup it's hard to select the right ones. We can remove that commit later if Don doesn't like it, but for now it's useful


[<Test>]
member this.AllPairs() =
let AllPairs() =

// integer Seq
let resultInt = Seq.allPairs (seq [1..7]) (seq [11..17])
Expand All @@ -50,7 +50,7 @@ type SeqModule() =
()

[<Test>]
member this.CachedSeq_Clear() =
let CachedSeq_Clear() =

let evaluatedItems : int list ref = ref []
let cachedSeq =
Expand Down Expand Up @@ -90,7 +90,7 @@ type SeqModule() =
()

[<Test>]
member this.Append() =
let Append() =

// empty Seq
let emptySeq1 = Seq.empty
Expand Down Expand Up @@ -135,7 +135,7 @@ type SeqModule() =
()

[<Test>]
member this.replicate() =
let replicate() =
// replicate should create multiple copies of the given value
Assert.IsTrue(Seq.isEmpty <| Seq.replicate 0 null)
Assert.IsTrue(Seq.isEmpty <| Seq.replicate 0 1)
Expand All @@ -146,7 +146,7 @@ type SeqModule() =


[<Test>]
member this.Average() =
let Average() =
// empty Seq
let emptySeq:seq<double> = Seq.empty<double>

Expand Down Expand Up @@ -182,7 +182,7 @@ type SeqModule() =


[<Test>]
member this.AverageBy() =
let AverageBy() =
// empty Seq
let emptySeq:seq<double> = Seq.empty<double>

Expand Down Expand Up @@ -216,7 +216,7 @@ type SeqModule() =
()

[<Test>]
member this.Cache() =
let Cache() =
// empty Seq
let emptySeq:seq<double> = Seq.empty<double>

Expand Down Expand Up @@ -257,7 +257,7 @@ type SeqModule() =
()

[<Test>]
member this.Case() =
let Case() =

// integer Seq
let integerArray = [|1;2|]
Expand Down Expand Up @@ -304,7 +304,7 @@ type SeqModule() =
()

[<Test>]
member this.Choose() =
let Choose() =

// int Seq
let intSeq = seq [1..20]
Expand Down Expand Up @@ -343,7 +343,7 @@ type SeqModule() =
()

[<Test>]
member this.ChunkBySize() =
let ChunkBySize() =

let verify expected actual =
Seq.zip expected actual
Expand Down Expand Up @@ -379,7 +379,7 @@ type SeqModule() =
()

[<Test>]
member this.SplitInto() =
let SplitInto() =

let verify expected actual =
Seq.zip expected actual
Expand Down Expand Up @@ -410,7 +410,7 @@ type SeqModule() =
()

[<Test>]
member this.Compare() =
let Compare() =

// int Seq
let intSeq1 = seq [1;3;7;9]
Expand Down Expand Up @@ -446,7 +446,7 @@ type SeqModule() =
()

[<Test>]
member this.Concat() =
let Concat() =
// integer Seq
let seqInt =
seq { for i in 0..9 do
Expand Down Expand Up @@ -482,7 +482,7 @@ type SeqModule() =
()

[<Test>]
member this.CountBy() =
let CountBy() =
// integer Seq
let funcIntCount_by (x:int) = x%3
let seqInt =
Expand Down Expand Up @@ -516,7 +516,7 @@ type SeqModule() =
()

[<Test>]
member this.Distinct() =
let Distinct() =

// integer Seq
let IntDistinctSeq =
Expand Down Expand Up @@ -550,7 +550,7 @@ type SeqModule() =
()

[<Test>]
member this.DistinctBy () =
let DistinctBy () =
// integer Seq
let funcInt x = x % 3
let IntDistinct_bySeq =
Expand Down Expand Up @@ -585,7 +585,7 @@ type SeqModule() =
()

[<Test>]
member this.Except() =
let Except() =
// integer Seq
let intSeq1 = seq { yield! {1..100}
yield! {1..100} }
Expand Down Expand Up @@ -624,7 +624,7 @@ type SeqModule() =
()

[<Test>]
member this.Exists() =
let Exists() =

// Integer Seq
let funcInt x = (x % 2 = 0)
Expand Down Expand Up @@ -659,7 +659,7 @@ type SeqModule() =
()

[<Test>]
member this.Exists2() =
let Exists2() =
// Integer Seq
let funcInt x y = (x+y)%3=0
let Intexists2Seq1 = seq [1;3;7]
Expand Down Expand Up @@ -687,7 +687,7 @@ type SeqModule() =


[<Test>]
member this.Filter() =
let Filter() =
// integer Seq
let funcInt x = if (x % 5 = 0) then true else false
let IntSeq =
Expand Down Expand Up @@ -726,7 +726,7 @@ type SeqModule() =
()

[<Test>]
member this.Find() =
let Find() =

// integer Seq
let funcInt x = if (x % 5 = 0) then true else false
Expand Down Expand Up @@ -755,7 +755,7 @@ type SeqModule() =
()

[<Test>]
member this.FindBack() =
let FindBack() =
// integer Seq
let funcInt x = x % 5 = 0
Assert.AreEqual(20, Seq.findBack funcInt <| seq { 1..20 })
Expand All @@ -782,7 +782,7 @@ type SeqModule() =
()

[<Test>]
member this.FindIndex() =
let FindIndex() =

// integer Seq
let digits = [1 .. 100] |> Seq.ofList
Expand All @@ -797,7 +797,7 @@ type SeqModule() =
()

[<Test>]
member this.Permute() =
let Permute() =
let mapIndex i = (i + 1) % 4

// integer seq
Expand All @@ -823,7 +823,7 @@ type SeqModule() =
()

[<Test>]
member this.FindIndexBack() =
let FindIndexBack() =
// integer Seq
let digits = seq { 1..100 }
let idx = digits |> Seq.findIndexBack (fun i -> i.ToString().Length = 1)
Expand All @@ -843,7 +843,7 @@ type SeqModule() =
()

[<Test>]
member this.Pick() =
let Pick() =

let digits = [| 1 .. 10 |] |> Seq.ofArray
let result = Seq.pick (fun i -> if i > 5 then Some(i.ToString()) else None) digits
Expand All @@ -857,7 +857,7 @@ type SeqModule() =
()

[<Test>]
member this.Fold() =
let Fold() =
let funcInt x y = x+y

let IntSeq =
Expand Down Expand Up @@ -889,7 +889,7 @@ type SeqModule() =


[<Test>]
member this.Fold2() =
let Fold2() =
Assert.AreEqual([(3,5); (2,3); (1,1)],Seq.fold2 (fun acc x y -> (x,y)::acc) [] (seq [ 1..3 ]) (seq [1..2..6]))

// integer List
Expand Down Expand Up @@ -921,7 +921,7 @@ type SeqModule() =
()

[<Test>]
member this.FoldBack() =
let FoldBack() =
// int Seq
let funcInt x y = x-y
let IntSeq = seq { 1..4 }
Expand Down Expand Up @@ -957,7 +957,7 @@ type SeqModule() =
()

[<Test>]
member this.foldBack2() =
let foldBack2() =
// int Seq
let funcInt x y z = x + y + z
let intSeq = seq { 1..10 }
Expand Down Expand Up @@ -996,7 +996,7 @@ type SeqModule() =
()

[<Test>]
member this.ForAll() =
let ForAll() =

let funcInt x = if x%2 = 0 then true else false
let IntSeq =
Expand Down Expand Up @@ -1027,7 +1027,7 @@ type SeqModule() =
()

[<Test>]
member this.ForAll2() =
let ForAll2() =

let funcInt x y = if (x+y)%2 = 0 then true else false
let IntSeq =
Expand Down Expand Up @@ -1058,7 +1058,7 @@ type SeqModule() =
CheckThrowsArgumentNullException (fun () -> Seq.forall2 funcInt nullSeq nullSeq |> ignore)

[<Test>]
member this.GroupBy() =
let GroupBy() =

let funcInt x = x%5

Expand Down Expand Up @@ -1101,7 +1101,7 @@ type SeqModule() =
()

[<Test>]
member this.DisposalOfUnstartedEnumerator() =
let DisposalOfUnstartedEnumerator() =
let run = ref false
let f() = seq {
try
Expand All @@ -1114,7 +1114,7 @@ type SeqModule() =
Assert.IsFalse(!run)

[<Test>]
member this.WeirdLocalNames() =
let WeirdLocalNames() =

let f pc = seq {
yield pc
Expand All @@ -1135,7 +1135,7 @@ type SeqModule() =
Assert.AreEqual([6;7;8], l)

[<Test>]
member this.Contains() =
let Contains() =

// Integer Seq
let intSeq = seq { 0..9 }
Expand Down
Loading