"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs" between
fsharp-4.1.33.tar.gz and fsharp-4.5.tar.gz

About: Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. fsharp is the F# compiler and core library.

ListModule2.fs  (fsharp-4.1.33):ListModule2.fs  (fsharp-4.5)
skipping to change at line 814 skipping to change at line 814
let resultStr = ["a";"b";"c";"d"] |> List.toSeq |> List.ofSeq let resultStr = ["a";"b";"c";"d"] |> List.toSeq |> List.ofSeq
Assert.AreEqual(["a";"b";"c";"d"], resultStr) Assert.AreEqual(["a";"b";"c";"d"], resultStr)
// empty List // empty List
let resultEpt =[] |> List.toSeq |> List.ofSeq let resultEpt =[] |> List.toSeq |> List.ofSeq
Assert.AreEqual(List.empty, resultEpt) Assert.AreEqual(List.empty, resultEpt)
() ()
[<Test>] [<Test>]
member this.Transpose() =
// integer list
Assert.AreEqual([[1; 4]; [2; 5]; [3; 6]], List.transpose (seq [[1..3]; [
4..6]]))
Assert.AreEqual([[1]; [2]; [3]], List.transpose [[1..3]])
Assert.AreEqual([[1..2]], List.transpose [[1]; [2]])
// string list
Assert.AreEqual([["a";"d"]; ["b";"e"]; ["c";"f"]], List.transpose (seq [
["a";"b";"c"]; ["d";"e";"f"]]))
// empty list
Assert.AreEqual([], List.transpose [])
// list of empty lists - m x 0 list transposes to 0 x m (i.e. empty)
Assert.AreEqual([], List.transpose [[]])
Assert.AreEqual([], List.transpose [[]; []])
// jagged lists
CheckThrowsArgumentException (fun () -> List.transpose [[1; 2]; [3]] |>
ignore)
CheckThrowsArgumentException (fun () -> List.transpose [[1]; [2; 3]] |>
ignore)
[<Test>]
member this.Truncate() = member this.Truncate() =
// integer list // integer list
Assert.AreEqual([1..3], List.truncate 3 [1..5]) Assert.AreEqual([1..3], List.truncate 3 [1..5])
Assert.AreEqual([1..5], List.truncate 10 [1..5]) Assert.AreEqual([1..5], List.truncate 10 [1..5])
Assert.AreEqual(([] : int list), List.truncate 0 [1..5]) Assert.AreEqual(([] : int list), List.truncate 0 [1..5])
// string list // string list
Assert.AreEqual(["str1";"str2"], List.truncate 2 ["str1";"str2";"str3"]) Assert.AreEqual(["str1";"str2"], List.truncate 2 ["str1";"str2";"str3"])
// empty list // empty list
 End of changes. 1 change blocks. 
0 lines changed or deleted 25 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)