forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssemblyReaderShim.fs
More file actions
25 lines (22 loc) · 833 Bytes
/
AssemblyReaderShim.fs
File metadata and controls
25 lines (22 loc) · 833 Bytes
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
module FSharp.Compiler.Service.Tests.AssemblyReaderShim
open FSharp.Compiler.Text
open FSharp.Compiler.AbstractIL.ILBinaryReader
open Xunit
[<Fact(Skip = "Flaky: seems to run fine locally but often fails in CI")>]
let ``Assembly reader shim gets requests`` () =
let defaultReader = AssemblyReader
let mutable gotRequest = false
let reader =
{ new IAssemblyReader with
member x.GetILModuleReader(path, opts) =
gotRequest <- true
defaultReader.GetILModuleReader(path, opts)
}
AssemblyReader <- reader
let source = """
module M
let x = 123
"""
let fileName, options = mkTestFileAndOptions [| |]
checker.ParseAndCheckFileInProject(fileName, 0, SourceText.ofString source, options) |> Async.RunImmediate |> ignore
gotRequest |> Assert.True