-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.fs
More file actions
46 lines (31 loc) · 1.08 KB
/
Program.fs
File metadata and controls
46 lines (31 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// The prime factors of 13195 are 5, 7, 13 and 29.
//
// What is the largest prime factor of the number 600851475143 ?
//
//explore FsCheck native (ie no xUnit.Net integration
open FsCheck
let revRevIsOrig (xs:list<int>) = List.rev(List.rev xs) = xs
Check.Quick revRevIsOrig
let revIsOrigBad (xs:list<int>) = List.rev xs = xs
Check.Quick revIsOrigBad
open global.Xunit
[<Fact>]
let ``Reverse of reverse of a list is the original list``() =
let revRevIsOrig (xs:list<int>) = List.rev(List.rev xs) = xs
Check.QuickThrowOnFailure revIsOrigBad
open FsCheck.Xunit
[<Property>]
let ``Reverse of reverse of a list is the original list ``(xs:list<int>) =
List.rev(List.rev xs) = xs
[<Property>]
let ``Reverse of reverse of a list is the original list bad``(xs:list<int>) =
List.rev xs = xs
//boilerplate
[<EntryPoint>]
let main argv =
printfn "args are %A" argv
if (System.Diagnostics.Debugger.IsAttached) then
printfn "[press any key]"
System.Console.ReadKey() |> ignore
0 // return an integer exit code