Skip to content

Commit

Permalink
refactor move duplicated functions to module
Browse files Browse the repository at this point in the history
  • Loading branch information
enricosada committed Apr 29, 2016
1 parent 7772bb0 commit aa8fc5f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 36 deletions.
1 change: 1 addition & 0 deletions tests/fsharp/FSharp.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
</Compile>
<Compile Include="..\..\src\fsharp\FSharp.Compiler.Unittests\NunitHelpers.fs" />
<Compile Include="nunitConf.fs" />
<Compile Include="FSharpTestSuiteAsserts.fs" />
<Compile Include="single-test-build.fs" />
<Compile Include="single-test-run.fs" />
<Compile Include="single-neg-test.fs" />
Expand Down
22 changes: 22 additions & 0 deletions tests/fsharp/FSharpTestSuiteAsserts.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module FSharpTestSuiteAsserts

open PlatformHelpers
open FSharpTestSuiteTypes

let requireVSUltimate cfg = attempt {
do! match cfg.INSTALL_SKU with
| Some (Ultimate) -> Success
| x ->
// IF /I "%INSTALL_SKU%" NEQ "ULTIMATE" (
// echo Test not supported except on Ultimate
NUnitConf.skip (sprintf "Test not supported except on Ultimate, was %A" x)
// exit /b 0
// )
}

let requireENCulture () = attempt {
do! match System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName with
| "en" -> Success
| c ->
NUnitConf.skip (sprintf "Test not supported except en Culture, was %s" c)
}
19 changes: 1 addition & 18 deletions tests/fsharp/core/tests_core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,10 @@ open NUnit.Framework
open NUnitConf
open PlatformHelpers
open FSharpTestSuiteTypes
open FSharpTestSuiteAsserts

let testContext = FSharpTestSuite.testContext

let requireVSUltimate cfg = attempt {
do! match cfg.INSTALL_SKU with
| Some (Ultimate) -> Success
| x ->
// IF /I "%INSTALL_SKU%" NEQ "ULTIMATE" (
// echo Test not supported except on Ultimate
NUnitConf.skip (sprintf "Test not supported except on Ultimate, was %A" x)
// exit /b 0
// )
}

let requireENCulture () = attempt {
do! match System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName with
| "en" -> Success
| c ->
NUnitConf.skip (sprintf "Test not supported except en Culture, was %s" c)
}

module Access =
[<Test; FSharpSuiteScriptPermutations("core/access")>]
let access p = check (attempt {
Expand Down
19 changes: 1 addition & 18 deletions tests/fsharp/typeProviders/tests_typeProviders.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,10 @@ open NUnit.Framework
open FSharpTestSuiteTypes
open NUnitConf
open PlatformHelpers
open FSharpTestSuiteAsserts

let testContext = FSharpTestSuite.testContext

let requireVSUltimate cfg = attempt {
do! match cfg.INSTALL_SKU with
| Some (Ultimate) -> Success
| x ->
// IF /I "%INSTALL_SKU%" NEQ "ULTIMATE" (
// echo Test not supported except on Ultimate
NUnitConf.skip (sprintf "Test not supported except on Ultimate, was %A" x)
// exit /b 0
// )
}

let requireENCulture () = attempt {
do! match System.Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName with
| "en" -> Success
| c ->
NUnitConf.skip (sprintf "Test not supported except en Culture, was %s" c)
}

module DiamondAssembly =

let build cfg dir = attempt {
Expand Down

0 comments on commit aa8fc5f

Please sign in to comment.