Skip to content

Commit

Permalink
More places in IDE unit tests that need to use Assembly.EscapedCodeBase
Browse files Browse the repository at this point in the history
  • Loading branch information
latkin committed Jun 17, 2015
1 parent 942d292 commit d02a425
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions vsintegration/src/unittests/Tests.LanguageService.General.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type GeneralTests() =

let publicTypesInAsm(asmfile : string) =
printfn "Validating assembly '%s'" asmfile
let codeBase = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath |> Path.GetDirectoryName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName
let asm = Assembly.LoadFrom(Path.Combine(codeBase, asmfile))

// For public types that have ComVisible, validate that the constructor is internal
Expand Down Expand Up @@ -175,7 +175,7 @@ type GeneralTests() =
member public this.``PublicSurfaceArea.DotNetReflectionAndTypeProviders``() =
let tp = publicTypesInAsm @"FSharp.Data.TypeProviders.dll"
Assert.AreEqual(1, tp) // the 'DataProviders' type that is decorated with [<TypeProvider>] must be public\
let curDir = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath |> Path.GetDirectoryName
let curDir = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName
let script = """
open Microsoft.FSharp.Core.CompilerServices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type MultiTargeting() =
member private this.prepTest(projFile) =
let dirName = Path.GetDirectoryName(projFile)
let libDirName = Directory.CreateDirectory(Path.Combine(dirName, "lib")).FullName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath |> Path.GetDirectoryName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName
let refLibPath = Path.Combine(libDirName, "FSharp.Core.Unittests.dll")
File.Copy(Path.Combine(codeBase, "FSharp.Core.Unittests.dll"), refLibPath)
File.AppendAllText(projFile, TheTests.FsprojTextWithProjectReferencesAndOtherFlags([], [refLibPath], [], null, "", "v2.0"))
Expand Down
4 changes: 2 additions & 2 deletions vsintegration/src/unittests/Tests.ProjectSystem.References.fs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ type References() =
DoWithTempFile "Test.fsproj"(fun projFile ->
let dirName = Path.GetDirectoryName(projFile)
let libDirName = Directory.CreateDirectory(Path.Combine(dirName, "lib")).FullName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath |> Path.GetDirectoryName
let codeBase = (new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase)).LocalPath |> Path.GetDirectoryName
let refLibPath = Path.Combine(libDirName, "nunit.core.dll")
File.Copy(Path.Combine(codeBase, "nunit.core.dll"), refLibPath)
File.AppendAllText(projFile, TheTests.SimpleFsprojText([], [refLibPath], ""))
Expand All @@ -574,7 +574,7 @@ type References() =
let l = new List<ReferenceContainerNode>()
project.FindNodesOfType(l)
l.[0]
let mscorlibPath = (new Uri("".GetType().Assembly.CodeBase)).LocalPath
let mscorlibPath = (new Uri("".GetType().Assembly.EscapedCodeBase)).LocalPath
let selectorData = new VSCOMPONENTSELECTORDATA(``type`` = VSCOMPONENTTYPE.VSCOMPONENTTYPE_ComPlus, bstrFile = mscorlibPath)
refContainer.AddReferenceFromSelectorData(selectorData) |> Assert.IsNotNull
let l = new List<AssemblyReferenceNode>()
Expand Down

0 comments on commit d02a425

Please sign in to comment.