PageRenderTime 20ms CodeModel.GetById 17ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/FingTest/Script.fsx

http://github.com/sandersn/fing
F# | 49 lines | 39 code | 2 blank | 8 comment | 5 complexity | e5206d4477534db1c2fd8b7f25a150f2 MD5 | raw file
 1// This file is a script that can be executed with the F# Interactive.  
 2// It can be used to explore and test the library project.
 3// Note that script files will not be part of the project build.
 4
 5#r @"C:/Program Files (x86)/FSharpPowerPack-2.0.0.0/bin/FSharp.PowerPack.Metadata.dll"
 6#I @"C:/src/Fing/Fing/Fing/bin/Debug/"
 7//#r @"Y:/src/Fing/fparsec/main/Build/VS9/bin/Debug/FParsec.dll"
 8#r @"FParsec.dll"
 9#r @"FParsecCS.dll"
10//#r "Y:/src/Fing/fparsec/main/Build/VS9/bin/Debug/FParsecCS.dll"
11#load @"C:\src\Fing\Fing\Fing\Util.fs"
12#load @"C:\src\Fing\Fing\Fing\Types.fs"
13#load @"C:\src\Fing\Fing\Fing\ParsedTypes.fs"
14#load @"C:\src\Fing\Fing\Fing\FSharpTypes.fs"
15#load @"C:\src\Fing\Fing\Fing\CSharpTypes.fs"
16#load @"C:\src\Fing\Fing\Fing\Parser.fs"
17#load @"C:\src\Fing\Fing\Fing\Search.fs"
18#load @"C:\src\Fing\Fing\Fing\Fing.fs"
19#load @"C:\src\Fing\Fing\FingTest\TestCases.fs"
20// #load "Tester.fs"
21open Types
22open Util
23let core = Microsoft.FSharp.Metadata.FSharpAssembly.FSharpLibrary
24let parsec = Microsoft.FSharp.Metadata.FSharpAssembly.FromFile "C:/src/Fing/Fing/Fing/bin/Debug/FParsec.dll"
25let ts = seq { // Seq.choose id (seq { 
26  for e in core.Entities do
27  for m in e.MembersOrValues do
28  yield {Fing.ent=e; Fing.mem=m; Fing.typ=FSharpTypes.cvt m.Type |> Types.index |> FSharpTypes.debinarize} 
29}
30let rawts = seq {
31  for e in core.Entities do
32  for m in e.MembersOrValues do
33  yield m
34}
35let indices = 1 |> Seq.unfold (fun i -> Some(i, i+1))
36// look for the indices of things that fail in cvt
37// TODO: Turn this into a test
38Seq.zip indices rawts
39 |> Seq.iter (fun (i,t) ->
40  try
41    (FSharpTypes.cvt t.Type) |> ignore
42    printf "." 
43  with _ ->
44    printfn "%d: %s . %s" i t.LogicalEnclosingEntity.DisplayName t.DisplayName
45 )
46FParsec.Primitives.preturn
47for i,t in Seq.zip indices ts do
48  printfn "%d. %s : %s" i (t.mem.DisplayName) (format <| Fing.tipe t)
49