Skip to content

Commit

Permalink
Simplified repro for #2679
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Apr 3, 2017
1 parent caa828b commit eee4d93
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/service/ProjectAnalysisTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4851,3 +4851,21 @@ let ``Test request for parse and check doesn't check whole project`` () =

()

[<Test>]
// Simplified repro for https://github.com/Microsoft/visualfsharp/issues/2679
let ``add files with same name from different folders`` () =
let fileNames =
[ __SOURCE_DIRECTORY__ + "/data/samename/folder1/a.fs"
__SOURCE_DIRECTORY__ + "/data/samename/folder2/a.fs" ]
let projFileName = __SOURCE_DIRECTORY__ + "/data/samename/tempet.fsproj"
let args = mkProjectCommandLineArgs ("test.dll", fileNames)
let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args)
let wholeProjectResults = checker.ParseAndCheckProject(options) |> Async.RunSynchronously
let errors =
wholeProjectResults.Errors
|> Array.filter (fun x -> x.Severity = FSharpErrorSeverity.Error)
if errors.Length > 0 then
printfn "add files with same name from different folders"
for err in errors do
printfn "ERROR: %s" err.Message
shouldEqual 0 errors.Length
5 changes: 5 additions & 0 deletions tests/service/data/samename/folder1/a.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace tempet

module SayA =
let hello name =
printfn "Hello %s" name
5 changes: 5 additions & 0 deletions tests/service/data/samename/folder2/a.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace tempet

module SayA =
let hello name =
printfn "Hello %s" name
13 changes: 13 additions & 0 deletions tests/service/data/samename/tempet.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="folder1/a.fs" />
<Compile Include="folder2/a.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="4.1.*" />
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
</ItemGroup>
</Project>

0 comments on commit eee4d93

Please sign in to comment.