Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'main/external/fsharpbinding/MonoDevelop.FSharp.Tests/Interactive.fs')
-rw-r--r--main/external/fsharpbinding/MonoDevelop.FSharp.Tests/Interactive.fs19
1 files changed, 15 insertions, 4 deletions
diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/Interactive.fs b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/Interactive.fs
index 42fe4222a1..802a33a067 100644
--- a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/Interactive.fs
+++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/Interactive.fs
@@ -110,12 +110,23 @@ module Interactive =
let ``Interactive send references uses real assemblies #43307``() =
async {
let! session = createSession()
- let directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
- let sln = directoryName / "Samples" / "bug43307" / "bug43307.sln"
- use monitor = new ConsoleProgressMonitor()
+ let sln = UnitTests.Util.GetSampleProject ("bug43307", "bug43307.sln")
+ use monitor = UnitTests.Util.GetMonitor ()
use! sol = Services.ProjectService.ReadWorkspaceItem (monitor, sln |> FilePath) |> Async.AwaitTask
use project = sol.GetAllItems<FSharpProject> () |> Seq.head
- project.GetOrderedReferences()
+
+ //workaround the fact that the project doesn't have a stable relative path
+ //to newtonsoft.json under the test harness by removing and re-adding with known path
+ let jsonAsmLoc = typeof<Newtonsoft.Json.JsonConvert>.Assembly.Location
+ let jsonRef =
+ project.References
+ |> Seq.filter (fun r -> r.Include.Equals "Newtonsoft.Json")
+ |> Seq.head
+ do project.References.Remove (jsonRef) |> ignore
+ project.References.Add (ProjectReference.CreateAssemblyFileReference (jsonAsmLoc |> FilePath))
+
+ let! refs = project.GetOrderedReferences(CompilerArguments.getConfig())
+ refs
|> List.iter (fun a -> sendInput session (sprintf @"#r ""%s"";;" a.Path))
let finished = new AutoResetEvent(false)
let input =