Skip to content

Commit

Permalink
Create failing test for #1262
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Nov 27, 2015
1 parent 79f407f commit 106215a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ type ProjectFile =
if not !hasHintPath then
yield node.Attributes.["Include"].InnerText.Split(',').[0] ]

member this.DeletePaketNodes(name) =
member this.DeletePaketNodes(name) =
let nodesToDelete = this.FindPaketNodes(name)
if nodesToDelete |> Seq.isEmpty |> not then
verbosefn " - Deleting Paket %s nodes" name
Expand Down Expand Up @@ -533,7 +533,7 @@ type ProjectFile =
if nodesToDelete <> [] then
verbosefn " - Deleting custom projects nodes for %O" model.PackageName

for node in nodesToDelete do
for node in nodesToDelete do
node.ParentNode.RemoveChild(node) |> ignore

member private this.GenerateAnalyzersXml(model:InstallModel) =
Expand Down Expand Up @@ -984,7 +984,7 @@ type ProjectFile =

this.GetPropertyWithDefaults "OutputPath" startingData
|> function
| None -> failwithf "Unable to find %s output path node in file %s" buildConfiguration this.FileName
| None -> failwithf "Unable to find %s output path node in file %s." buildConfiguration this.FileName
| Some s -> s.TrimEnd [|'\\'|] |> normalizePath

member this.GetAssemblyName () =
Expand Down
5 changes: 4 additions & 1 deletion tests/Paket.Tests/Paket.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -278,6 +278,9 @@
<None Include="ProjectFile\TestData\FSharp.Core.Fluent-3.1.fsprojtest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="ProjectFile\TestData\ReleasePath.csprojtest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="ProjectFile\ConditionSpecs.fs" />
<Compile Include="ProjectFile\TargetFrameworkSpecs.fs" />
<Compile Include="ProjectFile\FileBuildActionSpecs.fs" />
Expand Down
7 changes: 7 additions & 0 deletions tests/Paket.Tests/ProjectFile/OutputSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ let ``should detect output path for proj file``
ProjectFile.TryLoad(sprintf "./ProjectFile/TestData/%s.fsprojtest" project).Value.GetOutputDirectory configuration
|> shouldEqual (System.IO.Path.Combine(@"bin", configuration) |> normalizePath)

[<Test>]
let ``should detect output path for csproj file``() =
ProjectFile.TryLoad("./ProjectFile/TestData/ReleasePath.csprojtest").Value.GetOutputDirectory("Release")
|> shouldEqual ("bin" |> normalizePath)
()


[<Test>]
let ``should detect framework profile for ProjectWithConditions file`` () =
ProjectFile.TryLoad("./ProjectFile/TestData/ProjectWithConditions.fsprojtest").Value.GetTargetProfile()
Expand Down
18 changes: 18 additions & 0 deletions tests/Paket.Tests/ProjectFile/TestData/ReleasePath.csprojtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\..\build\bin\dialer\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

0 comments on commit 106215a

Please sign in to comment.