Skip to content

Commit 33c4b27

Browse files
committed
Create property test for Array.blit
1 parent e595e30 commit 33c4b27

File tree

1 file changed

+4
-2
lines changed
  • src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections

1 file changed

+4
-2
lines changed

src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ArrayProperties.fs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ let ``Array.distinctBy is stable`` () =
2121
Check.QuickThrowOnFailure distinctByStable<string>
2222

2323
let blitWorksLikeCopy<'a when 'a : comparison> (source : 'a [], sourceIndex, target : 'a [], targetIndex, count) =
24-
let a = runAndCheckIfAnyError (fun () -> Array.blit source sourceIndex target targetIndex count)
25-
let b = runAndCheckIfAnyError (fun () -> Array.Copy(source, sourceIndex, target, targetIndex, count))
24+
let target1 = Array.copy target
25+
let target2 = Array.copy target
26+
let a = runAndCheckIfAnyError (fun () -> Array.blit source sourceIndex target1 targetIndex count)
27+
let b = runAndCheckIfAnyError (fun () -> Array.Copy(source, sourceIndex, target2, targetIndex, count))
2628
a = b
2729

2830
[<Test>]

0 commit comments

Comments
 (0)