-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate "fsharpqa" suite to use NUnit
commit 9db27bae8df0444f794b70b12c4873cf55af08fc Merge: 2597c84 fc0ac12 Author: KevinRansom <codecutter@hotmail.com> Date: Thu Jan 21 16:49:35 2016 -0800 Merge branch 'fsharpqa_nunit' of https://github.com/enricosada/visualfsharp into enricosada-fsharpqa_nunit commit fc0ac12 Author: enricosada <enrico@sada.io> Date: Thu Jan 14 11:22:01 2016 +0100 add support for "<<OUTPUT" match commit c74d920 Author: enricosada <enrico@sada.io> Date: Wed Jan 13 12:59:55 2016 +0100 FIX TEST SPEC: use lowercase name for status attribute commit a86bb3b Author: enricosada <enrico@sada.io> Date: Tue Jan 12 23:16:25 2016 +0100 FIX TEST SPEC: use valid xml commit 12d683d Author: enricosada <enrico@sada.io> Date: Tue Jan 12 17:53:45 2016 +0100 deprecate some helper functions in tests attempt instead of processor computation ++ instead of / for Path.Combine commit e2d38c9 Author: enricosada <enrico@sada.io> Date: Sun Jan 10 17:33:03 2016 +0100 add fsharpqa tests
- Loading branch information
1 parent
2597c84
commit 736e9c1
Showing
13 changed files
with
2,301 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
#ignore all build outputs | ||
*.exe | ||
*.dll | ||
*.pdb |
2 changes: 1 addition & 1 deletion
2
tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
module EnvLst | ||
|
||
open System | ||
|
||
open PlatformHelpers | ||
|
||
type EnvLstFile = EnvLstLine list | ||
and EnvLstLine = | ||
| Comment of string | ||
| Data of EnvLstLineData | ||
and EnvLstLineData = { | ||
Tags: string list | ||
Vars: (string * string) list | ||
Comment: string option } | ||
|
||
let private (|Comment|_|) (s: string) = | ||
match s with | ||
| s when s.StartsWith("#") -> Some (s.TrimStart([| '#' |])) | ||
| _ -> None | ||
|
||
[<RequireQualifiedAccess>] | ||
type private DataPart = | ||
| Var of string * string | ||
| Comment of string | ||
|
||
let private parseDataParts (from: string) = | ||
let rec parseDataPartsHelper (v: string) xs = | ||
match (v.TrimStart()) with | ||
| s when s.Trim() = "" -> | ||
Choice1Of2 xs | ||
| Comment (comment) -> | ||
Choice1Of2 (DataPart.Comment comment :: xs) | ||
| s -> | ||
match s |> splitAtFirst ((=) '=') with | ||
| name, None -> | ||
Choice2Of2 (sprintf "Expected '=' after %s" name) | ||
| name, Some(v) -> | ||
match v.TrimStart() with | ||
| a when a.StartsWith("\"") -> //quoted (escape char \ ), like SOURCE="some value with spaces" | ||
let rec innerQuote (alreadyParsed: string) (s: string) = | ||
let current, rest = match s with "" -> "","" | x -> (x.Substring(0,1)), (x.Substring(1)) | ||
match alreadyParsed, current, rest with | ||
| pre, "", _ -> | ||
pre, "" | ||
| pre, "\"", xs when pre.EndsWith("\\") -> //escaped " | ||
innerQuote (pre + "\"") xs | ||
| pre, "\"", xs -> //final " | ||
pre, xs | ||
| pre, x, xs -> | ||
innerQuote (pre + x) xs | ||
let value, rest = innerQuote "" (a.Substring(1)) | ||
parseDataPartsHelper rest (DataPart.Var(name, value) :: xs) | ||
| a -> //unquoted, like SOURCE=avalue | ||
let value, rest = | ||
match a |> splitAtFirst Char.IsWhiteSpace with | ||
| p0, None -> p0, "" | ||
| p0, Some (rest) -> p0, rest | ||
parseDataPartsHelper rest (DataPart.Var(name, value) :: xs) | ||
|
||
match parseDataPartsHelper from [] with | ||
| Choice1Of2 parts -> parts |> List.rev |> Choice1Of2 | ||
| failure -> failure | ||
|
||
let parseLine (line: string) = | ||
match line with | ||
| s when s.Trim() = "" -> Choice1Of2 None | ||
| Comment(comment) -> Comment (comment) |> Some |> Choice1Of2 | ||
| s -> | ||
match s |> splitAtFirst ((=) '\t') with | ||
| s, None -> Choice2Of2 (sprintf "Expected '\\t' not found") | ||
| tagList, Some rest -> | ||
let tags = tagList.Split([| " " |], StringSplitOptions.RemoveEmptyEntries) | ||
match parseDataParts rest with | ||
| Choice1Of2 parts -> | ||
let vars = | ||
parts | ||
|> List.choose (function DataPart.Var (k,v) -> Some (k,v) | _ -> None) | ||
let comment = | ||
parts | ||
|> List.choose (function DataPart.Comment c -> Some c | _ -> None) | ||
|> List.tryHead | ||
Data { Tags = tags |> List.ofArray; Vars = vars; Comment = comment } | ||
|> Some |> Choice1Of2 | ||
| Choice2Of2 failure -> | ||
Choice2Of2 failure | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<FSharpSourcesRoot>..\..\..\src</FSharpSourcesRoot> | ||
<FSharpTestsRoot>..\..\..\tests</FSharpTestsRoot> | ||
<ProjectGuid>{21958DEB-133B-4760-A238-1293ED9687EC}</ProjectGuid> | ||
</PropertyGroup> | ||
<Import Project="$(FSharpSourcesRoot)\FSharpSource.Settings.targets" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<AllowCrossTargeting>true</AllowCrossTargeting> | ||
<ReferenceVsAssemblies>true</ReferenceVsAssemblies> | ||
<OutputType>Library</OutputType> | ||
<AssemblyName>FSharp.Tests.FSharpQA</AssemblyName> | ||
<Name>SystematicUnitTests</Name> | ||
<!-- Prevent compiler from inlining calls to FSharp.Core to improve code coverage accuracy --> | ||
<Optimize>false</Optimize> | ||
<Tailcalls>false</Tailcalls> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DefineConstants>$(DefineConstants);EXTENSIONTYPING</DefineConstants> | ||
<NoWarn>$(NoWarn);3180</NoWarn> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>3</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>3</WarningLevel> | ||
</PropertyGroup> | ||
<Import Project="$(FSharpSourcesRoot)\FSharpSource.targets" /> | ||
<ItemGroup> | ||
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj"> | ||
<Project>{DED3BBD7-53F4-428A-8C9F-27968E768605}</Project> | ||
<Name>FSharp.Core</Name> | ||
</ProjectReference> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="nunit.framework"> | ||
<HintPath>..\..\..\packages\NUnit.3.0.0\lib\net45\nunit.framework.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="$(FSharpTestsRoot)\fsharp\PlatformHelpers.fs"> | ||
<Link>PlatformHelpers.fs</Link> | ||
</Compile> | ||
<Compile Include="$(FSharpTestsRoot)\fsharp\Commands.fs"> | ||
<Link>Commands.fs</Link> | ||
</Compile> | ||
<Compile Include="$(FSharpTestsRoot)\fsharp\FSharpTestSuiteTypes.fs"> | ||
<Link>FSharpTestSuiteTypes.fs</Link> | ||
</Compile> | ||
<Compile Include="$(FSharpTestsRoot)\windowsPlatform.fs"> | ||
<Link>windowsPlatform.fs</Link> | ||
</Compile> | ||
<Compile Include="$(FSharpTestsRoot)\config.fs"> | ||
<Link>config.fs</Link> | ||
</Compile> | ||
<Compile Include="$(FSharpSourcesRoot)\update.fs"> | ||
<Link>update.fs</Link> | ||
</Compile> | ||
<Compile Include="EnvLst.fs" /> | ||
<Compile Include="nunitConf.fs" /> | ||
<Compile Include="run.fs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="test_EnvLst.fs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="test_simple.fs" /> | ||
</ItemGroup> | ||
</Project> |
2 changes: 1 addition & 1 deletion
2
tests/fsharpqa/Source/InteractiveSession/Misc/LoadOrderOfExecution3a.fsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//<Expects Status=success></Expects> | ||
//<Expects status="success"></Expects> | ||
|
||
//<<Output | ||
//Hello, world. | ||
|
Oops, something went wrong.