diff --git a/tests/fsharp/Commands.fs b/tests/fsharp/Commands.fs index 0b39e7af2d8..bf82ae9b39d 100644 --- a/tests/fsharp/Commands.fs +++ b/tests/fsharp/Commands.fs @@ -101,6 +101,10 @@ let msbuild exec msbuildExe flags srcFiles = let resgen exec resgenExe flags sources = exec resgenExe (sprintf "%s %s" flags (sources |> Seq.ofList |> String.concat " ")) +// %LINK_EXE% /dump /headers %AssemblyPath% +let link exec linkExe flags sources = + exec linkExe (sprintf "%s %s" flags (sources |> Seq.ofList |> String.concat " ")) + let internal quotepath (p: FilePath) = let quote = '"'.ToString() if p.Contains(" ") diff --git a/tests/fsharpqa/Source/.gitignore b/tests/fsharpqa/Source/.gitignore index d9a2cd109b0..7c3ce3a6482 100644 --- a/tests/fsharpqa/Source/.gitignore +++ b/tests/fsharpqa/Source/.gitignore @@ -3,3 +3,23 @@ *.exe *.dll *.pdb +*.il + +# test specific + +EntryPoint/E_CompilingToAModule01.netmodule + +XmlDoc/Basic/xmlDoc00*.xml +XmlDoc/Basic/XMLDocOnEnum01.xml +XmlDoc/OCamlDoc/ocamldoc001.xml + +Conformance/LexicalAnalysis/IdentifiersAndKeywords/test.ok + +Conformance/Signatures/SignatureConformance/InternalAccessibility02.fsi + +Stress/2766.fs +Stress/SeqExprCapacity.fs + +CompilerOptions/fsc/subsystemversion/dummy.netmodule + +CompilerOptions/fsi/help/help.txt diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs index d7f37d152cc..ec764831447 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyAlgorithmId -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs index 918cccc2b68..38550cb9e9d 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyCompany -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs index f159e63c11e..66257e21647 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyConfiguration -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs index b19fe0c9783..d5bf3b71587 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyCopyright -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs index 2a586e348c5..293ab4ad11a 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyDescription -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs index b507a18bd16..3b27e3a86df 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyFileVersion -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs index 45653540755..d5a58722193 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyInformationalVersion -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyProduct/AssemblyProduct_001.txt b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyProduct/AssemblyProduct_001.txt index c84d376ae2a..89108e894fa 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyProduct/AssemblyProduct_001.txt +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyProduct/AssemblyProduct_001.txt @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyProduct -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs index 4df4d7003be..01339cfcdb3 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyTitle -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs index 5942474dfd8..45fd7e6205e 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyTrademark -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs index 733384b1098..c855f442c20 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyVersion -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/test_ClrFx_PseudoCustomAttributes.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/test_ClrFx_PseudoCustomAttributes.fs new file mode 100644 index 00000000000..e6b067d7ad8 --- /dev/null +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/test_ClrFx_PseudoCustomAttributes.fs @@ -0,0 +1,107 @@ +module ``FSharpQA-Tests-ClrFx-PseudoCustomAttributes`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module AssemblyAlgorithmId = + + [] + let AssemblyAlgorithmId () = runpl |> check + + +module AssemblyCompany = + + [] + let AssemblyCompany () = runpl |> check + +module AssemblyConfiguration = + + [] + let AssemblyConfiguration () = runpl |> check + + +module AssemblyCopyright = + + [] + let AssemblyCopyright () = runpl |> check + + +module AssemblyDescription = + + [] + let AssemblyDescription () = runpl |> check + + +module AssemblyFileVersion = + + [] + let AssemblyFileVersion () = runpl |> check + + +module AssemblyInformationalVersion = + + [] + let AssemblyInformationalVersion () = runpl |> check + + +module AssemblyProduct = + + [] + let AssemblyProduct () = runpl |> check + + +module AssemblyTitle = + + [] + let AssemblyTitle () = runpl |> check + + +module AssemblyTrademark = + + [] + let AssemblyTrademark () = runpl |> check + + +module AssemblyVersion = + + [] + let AssemblyVersion () = runpl |> check + + +module NYI_AssemblyCulture = + + [] + let NYI_AssemblyCulture () = runpl |> check + + +module NYI_AssemblyDefaultAlias = + + [] + let NYI_AssemblyDefaultAlias () = runpl |> check + + +module NYI_AssemblyDelaySign = + + [] + let NYI_AssemblyDelaySign () = runpl |> check + + +module NYI_AssemblyFlags = + + [] + let NYI_AssemblyFlags () = runpl |> check + + +module NYI_AssemblyKeyFile = + + [] + let NYI_AssemblyKeyFile () = runpl |> check + + +module NYI_AssemblyKeyName = + + [] + let NYI_AssemblyKeyName () = runpl |> check diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs index 97f178a786f..d9dfb9ac86f 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs @@ -1,7 +1,7 @@ // #Regression #NoMono #NoMT #CodeGen #EmittedIL // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Verify that we can compile a module with an expression in it -// +// #light module M = diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/test_codegen_emittedil.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/test_codegen_emittedil.fs new file mode 100644 index 00000000000..41f9f403b4a --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/test_codegen_emittedil.fs @@ -0,0 +1,120 @@ +module ``FSharpQA-Tests-CodeGen-EmittedIL`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module AsyncExpressionStepping = + + [] + let AsyncExpressionStepping () = runpl |> check + +module AttributeTargets = + + [] + let AttributeTargets () = runpl |> check + +module CCtorDUWithMember = + + [] + let CCtorDUWithMember () = runpl |> check + +module CompiledNameAttribute = + + [] + let CompiledNameAttribute () = runpl |> check + +module ComputationExpressions = + + [] + let ComputationExpressions () = runpl |> check + +module DoNotBoxStruct = + + [] + let DoNotBoxStruct () = runpl |> check + +module GeneratedIterators = + + [] + let GeneratedIterators () = runpl |> check + +module InequalityComparison = + + [] + let InequalityComparison () = runpl |> check + +module ListExpressionStepping = + + [] + let ListExpressionStepping () = runpl |> check + +module MethodImplAttribute = + + [] + let MethodImplAttribute () = runpl |> check + +module Misc = + + [] + let Misc () = runpl |> check + +module Mutation = + + [] + let Mutation () = runpl |> check + +module Operators = + + [] + let Operators () = runpl |> check + +module QueryExpressionStepping = + + [] + let QueryExpressionStepping () = runpl |> check + +module SeqExpressionStepping = + + [] + let SeqExpressionStepping () = runpl |> check + +module SeqExpressionTailCalls = + + [] + let SeqExpressionTailCalls () = runpl |> check + +module SerializableAttribute = + + [] + let SerializableAttribute () = runpl |> check + +module StaticInit = + + [] + let StaticInit () = runpl |> check + +module SteppingMatch = + + [] + let SteppingMatch () = runpl |> check + + + +module TailCalls = + + [] + let TailCalls () = runpl |> check + +module TestFunctions = + + [] + let TestFunctions () = runpl |> check + +module Tuples = + + [] + let Tuples () = runpl |> check + diff --git a/tests/fsharpqa/Source/CodeGen/Structure/env.lst b/tests/fsharpqa/Source/CodeGen/Structure/env.lst index f7531107d77..86190b90052 100644 --- a/tests/fsharpqa/Source/CodeGen/Structure/env.lst +++ b/tests/fsharpqa/Source/CodeGen/Structure/env.lst @@ -40,8 +40,8 @@ SOURCE=LocalTypeFunctionInIf.fs # LocalTypeFunctionInIf.fs - REM DoNotInlineX.fs is a driver for the tests that follow - REM The command line args are explained in the source file +# DoNotInlineX.fs is a driver for the tests that follow +# The command line args are explained in the source file SOURCE=DoNotInlineX.fs # DoNotInlineX.fs SOURCE=dummy.fs POSTCMD="DoNotInlineX.exe PASS1 BASE_CALL 2 3" # DoNotInlineBaseCalls.fs SOURCE=dummy.fs POSTCMD="DoNotInlineX.exe PASS1 CAS 10 11" # DoNotInlineCASMethods.fs diff --git a/tests/fsharpqa/Source/CodeGen/test_CodeGen.fs b/tests/fsharpqa/Source/CodeGen/test_CodeGen.fs new file mode 100644 index 00000000000..be122797b15 --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/test_CodeGen.fs @@ -0,0 +1,17 @@ +module ``FSharpQA-Tests-CodeGen`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module StringEncoding = + + [] + let StringEncoding () = runpl |> check + +module Structure = + + [] + let Structure () = runpl |> check + diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs index 1d7f197fe2a..382cf1b56a5 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs @@ -3,7 +3,7 @@ // - The same source file (FunctionalLibrary01.fs) is compile twice, with different --codepage options // - The library file is designed so that it gets compiled to slightly different assemblies // - This file references both assemblies and should compile without problems -// +// #light diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx index eb417415555..d4ca66733d4 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions #load "FunctionalLibrary01.fs";; #q;; -// +// diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs index fb1d506c8e8..55e151c551b 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs @@ -1,7 +1,7 @@ // #NoMT #CompilerOptions // --codepage 0 // It does not mean much to me... -// +// #light let x = "a" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx index 89fa5e5b152..5e3eab73683 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx @@ -71,7 +71,7 @@ //section='NoSection ' ! option=splitting kind=OptionSwitch //section='NoSection ' ! option=versionfile kind=OptionString //section='NoSection ' ! option=times kind=OptionUnit -//section='NoSection ' ! option=showextensionresolution kind=OptionUnit +//section='NoSection ' ! option=showextensionresolution kind=OptionUnit //section='NoSection ' ! option=metadataversion kind=OptionString //section='NoSection ' ! option=d kind=OptionString //section='NoSection ' ! option=O kind=OptionSwitch diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/highentropyva/CheckHighEntropyASLR.bat.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/highentropyva/CheckHighEntropyASLR.bat.fs new file mode 100644 index 00000000000..50889408595 --- /dev/null +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/highentropyva/CheckHighEntropyASLR.bat.fs @@ -0,0 +1,60 @@ +module CheckHighEntropyASLR + +open NUnit.Framework + +open NUnitConf +open PlatformHelpers +open System.IO + +let run cwd envVars assemblyToCheck = attempt { + + let env key = envVars |> Map.tryFind key + let envOrDefault key def = env key |> Option.fold (fun s t -> t) def + + let fileExists = Commands.fileExists cwd + + let execOutToString p args = attempt { + let tempFile = Path.GetTempFileName() + do! Command.exec cwd envVars { Output = Output(Overwrite(tempFile)); Input = None } p args + |> checkResult + return File.ReadAllText(tempFile) + } + + // @echo off + ignore "unused" + + // REM Search for the Linker + // REM Use VS2015 or fall back to VS2014 + let! linkExe = attempt { + // SET LINK_EXE="%VS150COMNTOOLS%\..\..\VC\bin\link.exe" + // IF NOT EXIST %LINK_EXE% ( SET LINK_EXE="%VS140COMNTOOLS%..\..\VC\bin\link.exe" ) + // IF NOT EXIST %LINK_EXE% ( + // @echo "Test Requires LINK.EXE" --- Not found + // @echo "When installing VS please select "Select Visual C++ / Common Tools For Visual C++" + // ) + + let linkOpt = + [ "VS150COMNTOOLS"; "VS140COMNTOOLS" ] + |> List.choose env + |> List.map (sprintf @"%s\..\..\VC\bin\link.exe") + |> List.tryPick fileExists + return! match linkOpt with + | Some path -> succeed path + | None -> NUnitConf.genericError ( + "Test Requires LINK.EXE, --- Not found" + System.Environment.NewLine + + "When installing VS please select \"Select Visual C++ / Common Tools For Visual C++\"" ) + } + + //REM %LINK_EXE% -- Path to link.exe + //REM %1 -- assembly to check + ignore "from arguments" + //REM %2 -- expected value ("yes" or "no") + ignore "ignored, now the function return a bool" + + //%LINK_EXE% /dump /headers %1 | find "High Entropy Virtual Addresses" > NUL + //IF /I "%2"=="yes" IF ERRORLEVEL 1 EXIT /B 1 + //IF /I "%2"=="no" IF NOT ERRORLEVEL 1 EXIT /B 1 + let! link = Commands.link execOutToString linkExe "/dump /headers" [ assemblyToCheck ] + return link.Contains("High Entropy Virtual Addresses") + + } diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs index 069fcced085..0c54525d639 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -// +// exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/error08.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/error08.fs index ec82ca7463a..ba3b9d7288a 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/error08.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/error08.fs @@ -1,3 +1,3 @@ // #Regression #NoMT #CompilerOptions -//--lib: +//--lib: exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/error09.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/error09.fs index ec82ca7463a..ba3b9d7288a 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/error09.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/error09.fs @@ -1,3 +1,3 @@ // #Regression #NoMT #CompilerOptions -//--lib: +//--lib: exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs index 069fcced085..0c54525d639 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -// +// exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs index f6b04c2c5ef..4359bc00092 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions -// +// [] let main args = diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs index 13e56008605..a7ea6871f67 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions -// +// [] let main args = diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs index a8e2f22d2c0..5acad376be1 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs @@ -1,7 +1,7 @@ // Regression test for FSharp1.0:4849 // Title: Promote "-simpleresolution" to a documented compiler switch -//mscorlib -//FSharp.Core +//mscorlib +//FSharp.Core exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/subsystemversion/CheckSubsystemVersion.bat.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/subsystemversion/CheckSubsystemVersion.bat.fs new file mode 100644 index 00000000000..0dfda8dafa9 --- /dev/null +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/subsystemversion/CheckSubsystemVersion.bat.fs @@ -0,0 +1,59 @@ +module CheckSubsystemVersion + +open NUnit.Framework + +open NUnitConf +open PlatformHelpers +open System.IO + +let run cwd envVars assemblyToCheck expectedValue = attempt { + + let env key = envVars |> Map.tryFind key + let envOrDefault key def = env key |> Option.fold (fun s t -> t) def + + let fileExists = Commands.fileExists cwd + + let execOutToString p args = attempt { + let tempFile = Path.GetTempFileName() + do! Command.exec cwd envVars { Output = Output(Overwrite(tempFile)); Input = None } p args + |> checkResult + return File.ReadAllText(tempFile) + } + + // @echo off + ignore "unused" + + // REM Search for the Linker + // REM Use VS2015 or fall back to VS2014 + let! linkExe = attempt { + // SET LINK_EXE="%VS150COMNTOOLS%\..\..\VC\bin\link.exe" + // IF NOT EXIST %LINK_EXE% ( SET LINK_EXE="%VS140COMNTOOLS%..\..\VC\bin\link.exe" ) + // IF NOT EXIST %LINK_EXE% ( + // @echo "Test Requires LINK.EXE" --- Not found + // @echo "When installing VS please select "Select Visual C++ / Common Tools For Visual C++" + // ) + + let linkOpt = + [ "VS150COMNTOOLS"; "VS140COMNTOOLS" ] + |> List.choose env + |> List.map (sprintf @"%s\..\..\VC\bin\link.exe") + |> List.tryPick fileExists + return! match linkOpt with + | Some path -> succeed path + | None -> NUnitConf.genericError ( + "Test Requires LINK.EXE, --- Not found" + System.Environment.NewLine + + "When installing VS please select \"Select Visual C++ / Common Tools For Visual C++\"" ) + } + + // REM %LINK_EXE% -- Path to link.exe + // REM %1 -- assembly to check + // REM %2 -- expected value ("4.00" etc...) + ignore "from arguments" + + // %LINK_EXE% /dump /headers %1 | find "%2 subsystem version" > NUL + // IF ERRORLEVEL 1 EXIT /B 1 + // EXIT /B 0 + let! link = Commands.link execOutToString linkExe "/dump /headers" [ assemblyToCheck ] + StringAssert.Contains((sprintf "%s subsystem version" expectedValue), link) + + } diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/test_CompilerOptions_fsc.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/test_CompilerOptions_fsc.fs new file mode 100644 index 00000000000..3a0a25605ca --- /dev/null +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/test_CompilerOptions_fsc.fs @@ -0,0 +1,238 @@ +module ``FSharpQA-Tests-CompilerOptions-fsc`` + +open NUnit.Framework + +open NUnitConf +open PlatformHelpers +open RunPlTest + +module Removed = + + [] + let Removed () = runpl |> check + +module Checked = + + [] + let Checked () = runpl |> check + +module cliversion = + + [] + let cliversion () = runpl |> check + +module codepage = + + [] + let codepage () = runpl |> check + +module crossoptimize = + + [] + let crossoptimize () = runpl |> check + +module debug = + + [] + let debug () = runpl |> check + +module dumpAllCommandLineOptions = + + [] + let dumpAllCommandLineOptions () = runpl |> check + +module flaterrors = + + [] + let flaterrors () = runpl |> check + +module gccerrors = + + [] + let gccerrors () = runpl |> check + +module help = + + [] + let help () = runpl |> check + +module highentropyva = + + [] + let highentropyva () = check(attempt { + let checkHighEntropyASLR assemblyToCheck (expectedValue: bool) workDir (cfg: RunPl.RunPlConfig) = attempt { + let! f = CheckHighEntropyASLR.run workDir cfg.envVars assemblyToCheck + Assert.AreEqual(expectedValue, f) + } + + let cmds cmd = + match cmd with + | "CheckHighEntropyASLR.bat dummy.exe yes" -> + Some (checkHighEntropyASLR "dummy.exe" true) + | "CheckHighEntropyASLR.bat dummy.exe no" -> + Some (checkHighEntropyASLR "dummy.exe" false) + | _ -> None + + do! runplWithCmdsOverride cmds + + }) + +module invalid = + + [] + let invalid () = runpl |> check + +module lib = + + [] + let lib () = runpl |> check + +module noframework = + + [] + let noframework () = runpl |> check + +module nologo = + + [] + let nologo () = runpl |> check + +module Optimize = + + [] + let Optimize () = runpl |> check + +module out = + + [] + let out () = runpl |> check + +module pdb = + + [] + let pdb () = check(attempt { + + let ``IF EXIST {file} DEL {file}`` fileName workDir envVars = attempt { + let fileExists = Commands.fileExists workDir >> Option.isSome + let del = Commands.rm workDir + + if fileExists fileName then del fileName + } + + let ``IF EXIST {file} EXIT 1`` fileName workDir envVars = attempt { + let fileExists = Commands.fileExists workDir >> Option.isSome + + return! + if fileExists fileName + then NUnitConf.genericError (sprintf "Found not expected file '%s'" fileName) + else Success + } + + let ``IF NOT EXIST {file} EXIT 1`` fileName workDir envVars = attempt { + let fileExists = Commands.fileExists workDir >> Option.isSome + + return! + if not (fileExists fileName) + then NUnitConf.genericError (sprintf "Not found expected file '%s'" fileName) + else Success + } + + do! [ "IF EXIST pdb01.pdb DEL pdb01.pdb", ``IF EXIST {file} DEL {file}`` "pdb01.pdb" + "IF EXIST pdb01.pdb DEL pdb01.pdb", ``IF EXIST {file} DEL {file}`` "pdb01.pdb" + "IF EXIST pdb01x.pdb DEL pdb01x.pdb", ``IF EXIST {file} DEL {file}`` "pdb01x.pdb" + "IF EXIST pdb01x.pdb EXIT 1", ``IF EXIST {file} EXIT 1`` "pdb01x.pdb" + "IF EXIST pdb01.pdb EXIT 1", ``IF EXIST {file} EXIT 1`` "pdb01.pdb" + "IF NOT EXIST pdb01.pdb EXIT 1", ``IF NOT EXIST {file} EXIT 1`` "pdb01.pdb" + "IF NOT EXIST pdb01x.pdb EXIT 1", ``IF NOT EXIST {file} EXIT 1`` "pdb01x.pdb" ] + |> Map.ofList + |> runplWithCmds + + }) + + +module platform = + + [] + let platform () = runpl |> check + +module reference = + + [] + let reference () = runpl |> check + +module responsefile = + + [] + let responsefile () = runpl |> check + +module simpleresolution = + + [] + let simpleresolution () = runpl |> check + +module standalone = + + [] + let standalone () = runpl |> check + +module staticlink = + + [] + let staticlink () = runpl |> check + +module subsystemversion = + + [] + let subsystemversion () = check(attempt { + let checkSubsystemVersion assemblyToCheck expectedValue workDir (cfg: RunPl.RunPlConfig) = + CheckSubsystemVersion.run workDir cfg.envVars assemblyToCheck expectedValue + + let cmds cmd = + match cmd with + | StartsWith("CheckSubsystemVersion.bat dummy.exe ") p -> + Some (checkSubsystemVersion "dummy.exe" (p.Trim())) + | StartsWith("CheckSubsystemVersion.bat dummy.dll ") p -> + Some (checkSubsystemVersion "dummy.dll" (p.Trim())) + | StartsWith("CheckSubsystemVersion.bat dummy.netmodule ") p -> + Some (checkSubsystemVersion "dummy.netmodule" (p.Trim())) + | _ -> None + + do! runplWithCmdsOverride cmds + + }) + +module tailcalls = + + [] + let tailcalls () = runpl |> check + +module target = + + [] + let target () = runpl |> check + +module times = + + [] + let times () = runpl |> check + +module warn = + + [] + let warn () = runpl |> check + +module warnaserror = + + [] + let warnaserror () = runpl |> check + +module warnon = + + [] + let warnon () = runpl |> check + +module win32res = + + [] + let win32res () = runpl |> check + diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs index 30331de28d9..2466b7c8e67 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs @@ -14,46 +14,46 @@ namespace N2 module M3 = exit 0 -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import mscorlib\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Build Framework TC Imports\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Parse inputs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import DLLs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typecheck\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typechecked\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Interface File \] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write XML docs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write HTML docs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Encode Interface Data\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Initial simplify\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Lowertop optimization\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[TAST -> ILX\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[ILX -> IL\] -//ilwrite: TIME.+Write Started -//ilwrite: TIME.+Module Generation Preparation -//ilwrite: TIME.+Module Generation Pass 1 -//ilwrite: TIME.+Module Generation Pass 2 -//ilwrite: TIME.+Module Generation Pass 3 -//ilwrite: TIME.+Module Generation Pass 4 -//ilwrite: TIME.+Finalize Module Generation Results -//ilwrite: TIME.+Generated Tables and Code -//ilwrite: TIME.+Layout Header of Tables -//ilwrite: TIME.+Build String/Blob Address Tables -//ilwrite: TIME.+Sort Tables -//ilwrite: TIME.+Write Header of tablebuf -//ilwrite: TIME.+Write Tables to tablebuf -//ilwrite: TIME.+Layout Metadata -//ilwrite: TIME.+Write Metadata Header -//ilwrite: TIME.+Write Metadata Tables -//ilwrite: TIME.+Write Metadata Strings -//ilwrite: TIME.+Write Metadata User Strings -//ilwrite: TIME.+Write Blob Stream -//ilwrite: TIME.+Fixup Metadata -//ilwrite: TIME.+Generated IL and metadata -//ilwrite: TIME.+Layout image -//ilwrite: TIME.+Writing Image -//ilwrite: TIME.+Finalize PDB -//ilwrite: TIME.+Signing Image -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write .NET Binary\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Config File\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Stats File\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Copy referenced files\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import mscorlib\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Build Framework TC Imports\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Parse inputs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import DLLs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typecheck\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typechecked\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Interface File \] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write XML docs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write HTML docs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Encode Interface Data\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Initial simplify\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Lowertop optimization\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[TAST -> ILX\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[ILX -> IL\] +//ilwrite: TIME.+Write Started +//ilwrite: TIME.+Module Generation Preparation +//ilwrite: TIME.+Module Generation Pass 1 +//ilwrite: TIME.+Module Generation Pass 2 +//ilwrite: TIME.+Module Generation Pass 3 +//ilwrite: TIME.+Module Generation Pass 4 +//ilwrite: TIME.+Finalize Module Generation Results +//ilwrite: TIME.+Generated Tables and Code +//ilwrite: TIME.+Layout Header of Tables +//ilwrite: TIME.+Build String/Blob Address Tables +//ilwrite: TIME.+Sort Tables +//ilwrite: TIME.+Write Header of tablebuf +//ilwrite: TIME.+Write Tables to tablebuf +//ilwrite: TIME.+Layout Metadata +//ilwrite: TIME.+Write Metadata Header +//ilwrite: TIME.+Write Metadata Tables +//ilwrite: TIME.+Write Metadata Strings +//ilwrite: TIME.+Write Metadata User Strings +//ilwrite: TIME.+Write Blob Stream +//ilwrite: TIME.+Fixup Metadata +//ilwrite: TIME.+Generated IL and metadata +//ilwrite: TIME.+Layout image +//ilwrite: TIME.+Writing Image +//ilwrite: TIME.+Finalize PDB +//ilwrite: TIME.+Signing Image +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write .NET Binary\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Config File\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Stats File\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Copy referenced files\] diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs index 9a2eb16929f..6e05e0ecd5d 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #CompilerOptions // Regression test for FSHARP1.0:3789 // Unfixable warning 45 -// +// #nowarn "0988" type I = abstract M : unit -> unit diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs index 149d67a2537..87c27a1af80 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs @@ -1,8 +1,8 @@ // #Regression #NoMT #CompilerOptions // Regression test for FSHARP1.0:4867 // nowarn has no effect if "Warning level = 4" and "Warnings as errors" -//FS0040 -//FS0021 +//FS0040 +//FS0021 #nowarn "21" #nowarn "40" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx index a34de38edf4..850d3d4651d 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments01\.fsx"\|] +// Args: \[\|"PassedArguments01\.fsx"\|] printfn "Args: %A" fsi.CommandLineArgs #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx index 5b6819251b6..5783d48aa60 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments02\.fsx"; "Alpha"; "Beta Gamma"; "foo\.fs"\|] +// Args: \[\|"PassedArguments02\.fsx"; "Alpha"; "Beta Gamma"; "foo\.fs"\|] printfn "Args: %A" fsi.CommandLineArgs #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs index fcdc1430a1b..d72645a1a25 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs @@ -1,3 +1,3 @@ -// Args: \[\|"PassedArguments03\.fs"\|] +// Args: \[\|"PassedArguments03\.fs"\|] printfn "Args: %A" fsi.CommandLineArgs \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx index 65477eb854f..1215d0fdc3d 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] -// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] +// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] +// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] printfn "Args: %A" fsi.CommandLineArgs \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx index d6d041937b3..862906b1ce9 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx @@ -1,2 +1,2 @@ -// error FS0078:.+ +// error FS0078:.+ #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx index f56d132a6dd..6909de053cc 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -//NOTE +//NOTE #q;; diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/test_CompilerOptions_fsi.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/test_CompilerOptions_fsi.fs new file mode 100644 index 00000000000..31b6e0b1ac4 --- /dev/null +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/test_CompilerOptions_fsi.fs @@ -0,0 +1,66 @@ +module ``FSharpQA-Tests-CompilerOptions-fsi`` + +open NUnit.Framework + +open NUnitConf +open PlatformHelpers +open RunPlTest + + +module arguments = + + [] + let arguments () = runpl |> check + + +module exename = + + [] + let exename () = runpl |> check + + +module help = + + [] + let help () = check(attempt { + + let ``\$FSI_PIPE >{file} {args} 2>&1`` fileName args workDir (cfg: RunPl.RunPlConfig) = attempt { + let ``exec >a 2>&1`` p = + Command.exec workDir cfg.envVars { Output = OutputAndError(Overwrite(fileName)); Input = None } p + >> checkResult + + do! Commands.fsi ``exec >a 2>&1`` cfg.FSI_PIPE args [] + } + + do! [ @"\$FSI_PIPE >help.txt -? 2>&1", ``\$FSI_PIPE >{file} {args} 2>&1`` "help.txt" "-?" + @"\$FSI_PIPE >help.txt --help 2>&1", ``\$FSI_PIPE >{file} {args} 2>&1`` "help.txt" "--help" + @"\$FSI_PIPE >help.txt /? 2>&1", ``\$FSI_PIPE >{file} {args} 2>&1`` "help.txt" "/?" + @"\$FSI_PIPE >help.txt --nologo -? 2>&1", ``\$FSI_PIPE >{file} {args} 2>&1`` "help.txt" "--nologo -?" ] + |> Map.ofList + |> runplWithCmds + + }) + + +module highentropyva = + + [] + let highentropyva () = runpl |> check + + +module nologo = + + [] + let nologo () = runpl |> check + + +module subsystemversion = + + [] + let subsystemversion () = runpl |> check + + +module times = + + [] + let times () = runpl |> check diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx index 8231d242071..a06a2fa3adb 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions -// +// #light exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs index 66d43ff9466..436438570c1 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions -//TIME.+Optimizations +//TIME.+Optimizations exit 0;; diff --git a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs index 6af08bb7826..94ea43df5a6 100644 --- a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #BasicGrammarElements #Constants #NETFX40Only #NoMono #NETFX20Only // This is a positive test on Dev10, at least until // FSHARP1.0:4523 gets resolved. -// +// let ok = 1.0E-50M // parses ok on Dev10 diff --git a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs index 3f358cb2754..d2ce98e00a7 100644 --- a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs @@ -3,7 +3,7 @@ // Prefix only operators: !OP, ?OP, ~OP // Try to use !OP as an infix-op is an error // ?OP ~OP -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/test_Conformance_BasicGrammarElements.fs b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/test_Conformance_BasicGrammarElements.fs new file mode 100644 index 00000000000..fac7afd86aa --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/test_Conformance_BasicGrammarElements.fs @@ -0,0 +1,24 @@ +module ``FSharpQA-Tests-Conformance-BasicGrammarElements`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module Constants = + + [] + let Constants () = runpl |> check + + +module OperatorNames = + + [] + let OperatorNames () = runpl |> check + + +module PrecedenceAndOperators = + + [] + let PrecedenceAndOperators () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx index 055894027ff..4aac243eadf 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Abbreviation - using short and long identifiers -// +// #light module M = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx index 38f8c465856..087a7a40630 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // This is the sample code that appears in the specs under 9.4 -// +// #light exception ThatWentBadlyWrong of string * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx index 33ed3c37769..c7e13ce9e77 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // Exception values may be generated by defining and using classes that extends System.Exception // In this test we verify that both defitions can be used interchangably -// +// type E1(s) = class inherit System.Exception(s) diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx index 1f4d6c24d21..5184278d076 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // Exception definition define new discriminated union cases // Verify that we can use misc types (notice that the "sig-spec" cannot be used [covered in another testcase] -// +// #light exception E1 diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx index 9fa3d94c69f..c0b62be04ca 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx @@ -2,7 +2,7 @@ // An exception definition no longer generates a type with name idException // (this used to be the case until Dev10 Beta1, but not anymore) // In this case we check and see what happens when such a type already exist -// +// exception E of string type EException = | EE diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx index e9dd9c03e5a..7a27a7ca85c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Import C# exception in F# -// +// #light #r "CSharpException.dll" diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx index 305c5ef9e1d..806cb29ed94 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Specify and match on named fields -// +// exception AAA of V1 : int * V2 : int * V3 : string exception BBB of bool * bool diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx index 0b09b6befba..1cb548bd737 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx @@ -2,7 +2,7 @@ // Exception definition define new discriminated union cases // Verify that we can use misc types (notice that the "sig-spec" cannot be used [covered in another testcase] // This is reqgression test for FSHARP1.0:3725 -// +// [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx index 2efcb980ff7..ad08703e8c0 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // This is the sample code that appears in the specs under 9.4 // It shows how to use exceptions in pattern match -// +// #light exception Error of int * string diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx index 5c240f9bdc7..0971bca358d 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Arrays -// +// let samples = [ [|1;1+1|] = [|1;2|]; [|hash (1,1+1)|] = [|hash (1,2)|]; diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx index 7492fef2873..df1081f8e07 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on exception // See bug FSHARP1.0:5345 -// +// exception E of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx index e9857b417b6..45b1a9b3007 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Record -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx index 80f3468d47f..5241648be98 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // List -// +// let samples = [ [1;1+1] = [1;2]; // tuples support structural equality [hash (1,1+1)] = [hash (1,2)]; // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx index 43b309619a5..188aa419588 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Classes -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx index 2b2abb21a6f..00dbdb7c4aa 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Delegate -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx index 6997648873e..1305080924c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Interface -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx index 2a23ced7f95..ad0945f5954 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Options // Interesting case: Some vs None -// +// let samples = [ Some(1,1+1) = Some(1,2); // tuples support structural equality Some(hash (1,1+1)) = Some(hash (1,2)); // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx index aecacd74ee5..96a9518be1e 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on records -// +// type R = R of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx index 30044004352..e90c48f0632 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on records -// +// let samples = [ (1,1+1) = (1,2); // tuples support structural equality hash (1,1+1) = hash (1,2); // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx index 959e012f670..e5a163f92a8 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Structs -// +// type S<'a> = struct new ( a:'a ) = { f = a } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx index 89a77d2e228..bafeef6d6eb 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Unions -// +// type DU = | A | B diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx index a322a5053bb..0d9d10e2caf 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Light syntax: begin/end can be omitted -// +// #light module N1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs index bf3f02a16ea..a4eb1fe2322 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Module abbreviation: // Trying to abbreviate a module is ok -// +// #light // Module abbreviations diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx index 08af03fe86f..9ce7dfd7feb 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Decorating a module with the CompilationRepresentation -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs index b1ca8692338..b4e987a1520 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #TypesAndModules #Modules // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Verify that we can compile a module with an expression in it -// +// #light module M = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs index 1368f2aabe5..de640d9e72c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2644 (a module may start with an expression) // This is unfortunate, but this is the current behavior for this release. // So, the workaround is to use begin... end -// +// #light module M2 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx index af3a544868d..d66062890bc 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M4 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx index 62b675e22ec..0c280103325 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M7 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx index 2420054016f..bdd1915e30a 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M1 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx index 80e2b4dca46..f4e122d45d8 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M2 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx index 8e33910fde9..0e0b33c6116 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M6 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx index 5cb177ab565..72b6bb5de9c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M5 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx index e1d533892ed..ad3085500b5 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Modules // Productions // Compile with: --mlcompatibility -a --warnaserror+ -// +// #light module N1 = struct diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx index 2e7d213e138..7eb95ab5c8e 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M3 = begin type T = | A = 1 diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/env.lst b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/env.lst index 5c55eedb23e..5dad6c24589 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/env.lst +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/env.lst @@ -34,7 +34,7 @@ NoMT SOURCE=ModuleSuffix03.fsx PRECMD="\$FSC_PIPE -a ModuleSuffix03Lib.fsx" SCFL SOURCE=E_ObsoleteAttribOnModules01.fs SCFLAGS="--test:ErrorRanges" # E_ObsoleteAttribOnModules01.fs - #These 2 are not actual testcases, just test libraries for the next 2 +# These 2 are not actual testcases, just test libraries for the next 2 SOURCE=LibFoo1.fs SCFLAGS="-a" SOURCE=LibFOo2.fs SCFLAGS="-a" SOURCE=SameTypeInTwoReferences01.fs SCFLAGS="-r:LibFoo1.dll -r:LibFoo2.dll" # SameTypeInTwoReferences01.fs diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx index e1fc1df313c..76a42060e73 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx index dab0aae3fd4..a2c6072efc5 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx @@ -3,7 +3,7 @@ // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx index 1a05f0322ba..d23f40d38f6 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // By default, record types implement IComparable -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx index bbfd268769e..f107174b968 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // This test is a bit of a kitchen-sink, but its main // purpose is to validate that we can use fully qualified field names -// +// #light type ı = int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx index 9ccfb90db7b..32b251c047c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Record types may include members // Test both static and instance members -// +// #light // Instance member diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx index 4f148fcd617..049ec44f13c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Verify that record fields may be marked mutable // In this case, only one field is marked as mutable -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx index 734682db99e..d90102244bd 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 (second code snippet) -// +// #light type R2 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx index 7fe45138971..41fe778adc3 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 -// +// #light type R1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx index 007989b7a82..22d4a314017 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 (3rd code snippet) -// +// #light type R = { dx : int; dy: int } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx index e7a5527184c..ac35685aa01 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // Field labels have module scope -// +// #light type T1 = { a : decimal } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx index c64eab36cc9..5fd5f32742f 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Field labels have module scope // Also, in this case we see that there is no collision when the field and type have the same name -// +// #light type ı = int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx index 380c7a54380..2735d24b515 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // Field has type 'unit' (which is kind of special) -// +// #light type T1 = { u : unit;} diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx index c5df98643ea..b6c2be98862 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules // Abbreviation: the constraints on the right-hand-side are sufficient -// +// #light type IA = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx index 5d6d34022f9..9d1f5733876 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules // Type abbreviation // A type that redefine itself -- not very useful, but ok -// +// #light type Z = Z // ok (useless, but ok) diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx index 377001a76ba..35a11690587 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx @@ -2,7 +2,7 @@ // Abbreviation: it is ok to reorder type variables // Used to be regression test for FSHARP1.0:3738 // It is now regression test for FSHARP1.0:4786 -// +// module M type Reverse<'a,'b> = 'b -> 'a diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx index a8a08368b18..66456c0d0f9 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules // Type abbreviation // The type nested in modules -// +// #light module M1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/env.lst b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/env.lst index e7c37165bce..a9fced5bbb0 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/env.lst +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/env.lst @@ -1,4 +1,4 @@ - xxx SOURCE=E_InfiniteAbbreviation01.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_InfiniteAbbreviation01.fs +# xxx SOURCE=E_InfiniteAbbreviation01.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_InfiniteAbbreviation01.fs SOURCE=E_InfiniteAbbreviation02.fs # E_InfiniteAbbreviation02.fs SOURCE=E_UnexpectedCharInTypeName01.fs SCFLAGS="--test:ErrorRanges" # E_UnexpectedCharInTypeName01.fs diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx index 44eb0b1bacb..9cec35e1c95 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light type T1 = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx index 7c256533dcd..e098945c59b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement dispatch slot GetHashCode // We also minimally verify that the hash codes are different for this simple case -// +// #light type T1 = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx index d70e164488b..263007b6093 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // DU may include implement interfaces -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx index 51eeaf412e9..d2692cf9af9 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement IComparable -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx index 9ba75b652d7..c3fbee93b7e 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // DU may include members // Test both static and instance members -// +// #light // Instance member diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx index f771144bfca..e4fe32ea353 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Constructing DUs with named fields -// +// type Lunch = | Sandwich of meat : string * pickles : bool * layers : int | Soup of Ounces : float * string diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx index 0585842d8b0..4d7d6b92703 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Should be able to pattern match using named or positional fields -// +// type MyDU = | Case1 of int * int * int * Named1 : int * Named2 : int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx index 263ea8620e4..70c518c1930 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Potentially ambiguous cases where we need to decide if user is specifying named argument or passing result of equality comparison to boolean/generic field -// +// let checkType (o : obj) ty = if o.GetType() = ty then () diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx index 334e604d724..54bf0f4b11f 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // DU may include overrides -// +// [] [] diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx index 71561c2a87e..cf39d596adb 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Paretheses are significant in DU definitions -// +// #light type T = | C of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx index 2bc63a34c34..ab64c103be7 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx @@ -2,7 +2,7 @@ // DU - with recursive definition // Note: don't try to make much sense of this code. // It's a rather (intentionally) convoluted code. -// +// #light type E = | Sum of E * E diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx index ecdd581962f..163d70cd452 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // Union Types // Sample from spec - using #light "off" -// +// #light "off" (* extra space *) type Message = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx index 6b01a68a9ed..cd241344ffd 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx @@ -4,7 +4,7 @@ // The with/end tokens can be omitted when using the #light syntax option as long as the // type-defn-elements vertically aligns with the first ‘|’ in the union-cases // Regression test for FSHARP1.0:3707 -// +// #light (* extra space *) type Message = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx index 30687482605..0917601943b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx @@ -4,7 +4,7 @@ // It also covers the fact that they can be used both as data constructors // and to form patterns. // This is the positive case. -// +// #light [] type ı diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx index f182ae8ce49..af214bf2b49 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx @@ -4,7 +4,7 @@ // | id -- nullary union case // | id of type * ... * type -- n-ary union case // | id : sig-spec -- n-ary union case -// +// #light type T = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx index 5596aefbd1c..e2150095cef 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // Union Types // union-cases := [ ‘|’ ] union-case ‘|’ ... ‘|’ union-case -// +// #light // With missing | diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst index c979c25d016..79bdb21d7ad 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/env.lst @@ -20,7 +20,7 @@ NoMT SOURCE=Overload_ToString.fs COMPILE_ONLY=1 SCFLAGS=--warnaserror+ FSIMOD SOURCE=E_UnionsNotNull01.fs # E_UnionsNotNull01.fs SOURCE=E_UnionsNotNull02.fs # E_UnionsNotNull02.fs - SOURCE=BeginWithUppercase01.fsx SCFLAGS= # BeginWithUppercase01.fsx + SOURCE=BeginWithUppercase01.fsx SCFLAGS="" # BeginWithUppercase01.fsx # Renaming the .exe because for some weird reason on some OSes having 'DispatchSlot' in the .exe # seems to trigger the UAC dialog... (e.g. Win7 x86) @@ -44,9 +44,9 @@ NoMT SOURCE=Overload_ToString.fs COMPILE_ONLY=1 SCFLAGS=--warnaserror+ FSIMOD SOURCE=E_ScopeAndDataConstrAndPattern01.fsx SCFLAGS="--test:ErrorRanges" # E_ScopeAndDataConstrAndPattern01.fsx - SOURCE=Interface01.fsx SCFLAGS= # Interface01.fsx + SOURCE=Interface01.fsx SCFLAGS="" # Interface01.fsx - SOURCE=Interface_IComparable.fsx SCFLAGS= # Interface_IComparable.fsx + SOURCE=Interface_IComparable.fsx SCFLAGS="" # Interface_IComparable.fsx SOURCE=E_Interface_IStructuralHash.fsx # E_Interface_IStructuralHash.fsx @@ -60,21 +60,21 @@ NoMT SOURCE=Overload_ToString.fs COMPILE_ONLY=1 SCFLAGS=--warnaserror+ FSIMOD SOURCE=Parenthesis03.fsx # Parenthesis03.fsx - SOURCE=Recursive01.fsx SCFLAGS= # Recursive01.fsx + SOURCE=Recursive01.fsx SCFLAGS="" # Recursive01.fsx - SOURCE=SampleFromSpec01.fsx SCFLAGS= # SampleFromSpec01.fsx + SOURCE=SampleFromSpec01.fsx SCFLAGS="" # SampleFromSpec01.fsx - SOURCE=SampleFromSpec01b.fsx SCFLAGS= # SampleFromSpec01b.fsx + SOURCE=SampleFromSpec01b.fsx SCFLAGS="" # SampleFromSpec01b.fsx SOURCE=W_SampleFromSpec01c.fsx SCFLAGS="--test:ErrorRanges" # W_SampleFromSpec01c.fsx - SOURCE=SampleFromSpec01d.fsx SCFLAGS= # SampleFromSpec01d.fsx + SOURCE=SampleFromSpec01d.fsx SCFLAGS="" # SampleFromSpec01d.fsx SOURCE=E_SampleFromSpec01d.fsx SCFLAGS="--test:ErrorRanges" # E_SampleFromSpec01d.fsx SOURCE=E_SampleFromSpec01d2.fsx SCFLAGS="--test:ErrorRanges" # E_SampleFromSpec01d2.fsx - SOURCE=ScopeAndDataConstrAndPattern01.fsx SCFLAGS= # ScopeAndDataConstrAndPattern01.fsx + SOURCE=ScopeAndDataConstrAndPattern01.fsx SCFLAGS="" # ScopeAndDataConstrAndPattern01.fsx SOURCE=UnionCaseProduction01.fsx SCFLAGS=-a # UnionCaseProduction01.fsx @@ -82,7 +82,7 @@ NoMT SOURCE=Overload_ToString.fs COMPILE_ONLY=1 SCFLAGS=--warnaserror+ FSIMOD SOURCE=W_UnionCaseProduction01.fsx SCFLAGS="-a --test:ErrorRanges" # W_UnionCaseProduction01.fsx - SOURCE=ReflectionOnUnionTypes01.fs SCFLAGS= # ReflectionOnUnionTypes01.fs + SOURCE=ReflectionOnUnionTypes01.fs SCFLAGS="" # ReflectionOnUnionTypes01.fs SOURCE=E_InheritUnion.fs # E_InheritUnion.fs SOURCE=E_UnionFieldNamedTag.fs SCFLAGS="--test:ErrorRanges" # E_UnionFieldNamedTag.fs @@ -93,9 +93,9 @@ NoMT SOURCE=Overload_ToString.fs COMPILE_ONLY=1 SCFLAGS=--warnaserror+ FSIMOD SOURCE=E_UnionMemberNamedTags.fs SCFLAGS="--test:ErrorRanges" #E_UnionMemberNamedTags.fs SOURCE=E_UnionMemberNamedTagsNoDefault.fs SCFLAGS="--test:ErrorRanges" #E_UnionMemberNamedTagsNoDefault.fs - SOURCE=NamedFields01.fsx SCFLAGS= # NamedFields01.fsx - SOURCE=NamedFields02.fsx SCFLAGS= # NamedFields02.fsx - SOURCE=NamedFields03.fsx SCFLAGS= # NamedFields03.fsx + SOURCE=NamedFields01.fsx SCFLAGS="" # NamedFields01.fsx + SOURCE=NamedFields02.fsx SCFLAGS="" # NamedFields02.fsx + SOURCE=NamedFields03.fsx SCFLAGS="" # NamedFields03.fsx SOURCE=E_UnionFieldConflictingName.fs SCFLAGS="--test:ErrorRanges" # E_UnionFieldConflictingName.fs SOURCE=E_UnionConstructorBadFieldName.fs SCFLAGS="--test:ErrorRanges" # E_UnionConstructorBadFieldName.fs SOURCE=E_FieldNameUsedMulti.fs SCFLAGS="--test:ErrorRanges" # E_FieldNameUsedMulti.fs diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/test_Conformance_BasicTypeAndModuleDefinitions.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/test_Conformance_BasicTypeAndModuleDefinitions.fs new file mode 100644 index 00000000000..0f45f54beb0 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/test_Conformance_BasicTypeAndModuleDefinitions.fs @@ -0,0 +1,75 @@ +module ``FSharpQA-Tests-Conformance-BasicTypeAndModuleDefinitions`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + + +module ExceptionDefinitions = + + [] + let ExceptionDefinitions () = runpl |> check + + +module GeneratedEqualityHashingComparison = + + module Attributes = + + module Diags = + [] + let Diags () = runpl |> check + + module Legacy = + [] + let Legacy () = runpl |> check + + module New = + [] + let New () = runpl |> check + + module Basic = + [] + let Basic () = runpl |> check + + module IComparison = + [] + let IComparison () = runpl |> check + + +module ModuleDefinitions = + + [] + let ModuleDefinitions () = runpl |> check + + +module NamespaceDeclGroups = + + [] + let NamespaceDeclGroups () = runpl |> check + + +module NullRepresentations = + + [] + let NullRepresentations () = runpl |> check + + +module RecordTypes = + + [] + let RecordTypes () = runpl |> check + + + +module TypeAbbreviations = + + [] + let TypeAbbreviations () = runpl |> check + + +module UnionTypes = + + [] + let UnionTypes () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx index eedaf6b9ef2..e85c42fe16d 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:3797 // Using bitwise OR (|||) in AttributeUsage works (same as WithBitwiseOr02b.fsx, on class) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx index 36ff507f7d7..39e628980d3 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:3797 // Using bitwise OR (|||) in AttributeUsage works (same as WithBitwiseOr02a.fsx, on struct) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs index a31c1267b4b..291c83011d4 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs @@ -1,8 +1,8 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:1708 // internal compiler error for free type variable in attribute -//internal error -// +//internal error +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs index 05412591a44..fdea8b78ee7 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2087 // Function parameter attributes are ignored and do not appear in the resulting assembly // Attribute is placed on a let-binding function definition -// +// #light open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs index b75aa1b4ab8..89a67dd4075 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2087 // Function parameter attributes are ignored and do not appear in the resulting assembly // Attribute is placed on the argument of a let-binding function definition -// +// #light open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs index 32842a0cebe..427aa2b82fc 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1165 // F# supports custom attributes on return type // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs index 355de813e7a..26bc70a04cd 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs @@ -3,7 +3,7 @@ // F# supports custom attributes on return type. // Multiple attributes on the same return value (two different attributes) // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs index 8f27434b167..0676010d0dc 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs @@ -3,7 +3,7 @@ // F# supports custom attributes on return type. // Multiple attributes on the same return value (same attribute repeated twice) // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs index e774ae5c32b..30fd53f58c7 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DeclarationElements #LetBindings // Verify errors associated with using let bindings + pattern matching -//Type mismatch\. Expecting a +//Type mismatch\. Expecting a let one, two = 1, 2, 3 diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs index a546fde44bd..1f3590543dd 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #LetBindings // Interesting pathological tests // The code is odd, but parses and typechecks fine! :) -// +// module TestModule let f _ _ _ _ _ _ _ _ _ _ = () diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs index db5aca52857..27015737d9a 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #LetBindings // Interesting pathological tests // The code is odd, but parses and typechecks fine! :) -// +// module TestModule let f _ _ _ _ _ _ _ _ _ _ = () diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs index 93953ffa217..12a318bdac5 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:1490 // Basic usage of typeof -// +// #light let x = typeof diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs index 389dfbb8da0..c315468d874 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:1490 // can't use typeof in attributes -// +// [)>] type TestTypeOnType() = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs index 181044fdacb..e0b29ab5585 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:2320 // Type passed to typeof<> is _ -// +// #light let _ = typeof<_> diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs index b214cf657ba..c4f77fe17d3 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #MemberDefinitions #Overloading // As of Beta2, we don't need OverloadIDs anymore! -// +// type Foo() = member this.SomeMethod (x:int) = true member this.SomeMethod (y:string) = false diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs index 96e0f5da737..acf58a5334e 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #MemberDefinitions #Overloading // Regression test for FSHARP1.0:3388 // overloaded operators which are more generic than their enclosing class -// +// #light type Foo<'a,'b>() = #if TOO_GENERIC diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs index 97ead5bc661..d476d1d24d3 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs @@ -1,5 +1,5 @@ // #Conformance #DeclarationElements #Modules -// +// #light module A = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs index 50a62b56c13..b9c510b3960 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #Modules // Use module abbreviation inside a module -// +// #light module A = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs index 3371d5ac8f4..24bb542c29f 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #Modules // Use module abbreviation inside a namespace -// +// #light namespace Faa.Bor diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs index e090adafeb1..61c682c267c 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #Modules #ReqNOMT // Use module abbreviation inside a namespace // Module is defined in an external assembly -// +// #light namespace Faa.Bor diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/test_Conformance_DeclarationElements.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/test_Conformance_DeclarationElements.fs new file mode 100644 index 00000000000..32f75474907 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/test_Conformance_DeclarationElements.fs @@ -0,0 +1,119 @@ +module ``FSharpQA-Tests-Conformance-DeclarationElements`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + + +module AccessibilityAnnotations = + + module basic = + [] + let basic () = runpl |> check + + module OnOverridesAndIFaceImpl = + [] + let OnOverridesAndIFaceImpl () = runpl |> check + + module OnTypeMembers = + [] + let OnTypeMembers () = runpl |> check + + module PermittedLocations = + [] + let PermittedLocations () = runpl |> check + + +module CustomAttributes = + + + module ArgumentsOfAllTypes = + [] + let ArgumentsOfAllTypes () = runpl |> check + + module AttributeUsage = + [] + let AttributeUsage () = runpl |> check + + module Basic = + [] + let Basic () = runpl |> check + + module ImportedAttributes = + [] + let ImportedAttributes () = runpl |> check + + +module Events = + + module basic = + + [] + let basic () = runpl |> check + + +module FieldMembers = + + [] + let FieldMembers () = runpl |> check + + +module ImportDeclarations = + + [] + let ImportDeclarations () = runpl |> check + + +module InterfaceSpecificationsAndImplementations = + + [] + let InterfaceSpecificationsAndImplementations () = runpl |> check + + +module LetBindings = + + module ActivePatternBindings = + + [] + let ActivePatternBindings () = runpl |> check + + module Basic = + + [] + let Basic () = runpl |> check + + module ExplicitTypeParameters = + + [] + let ExplicitTypeParameters () = runpl |> check + + module TypeFunctions = + + [] + let TypeFunctions () = runpl |> check + + +module MemberDefinitions = + + [] + let MemberDefinitions () = runpl |> check + + +module ModuleAbbreviations = + + [] + let ModuleAbbreviations () = runpl |> check + + +module ObjectConstructors = + + [] + let ObjectConstructors () = runpl |> check + + +module PinvokeDeclarations = + + [] + let PinvokeDeclarations () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs b/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs index d7741016041..a20dcca4dd3 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #ControlFlow // Regression test for FSHARP1.0:2323 (Compiler ICE when matching on literal Null) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx index 1161e8d27a6..1611af55de7 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx @@ -2,7 +2,7 @@ // AddressOf Operator // Verify we can use the & operator to invoke .Net method (byref) // In this case we call into a C# method (ref) -// +// #light #r @"addressof001dll.dll" diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx index 52368cae5f9..519f256a377 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx @@ -2,7 +2,7 @@ // AddressOf Operator // Verify we can use the & operator to invoke .Net method (byref) // In this case we call into a C# method (out) -// +// #light #r @"addressof002dll.dll" diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx index c36bea78fdd..77159f616a2 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions // Regression test for FSHARP1.0:4183 // Assert failed in code that take the address of a local of type unit -// +// let f () = let dict = System.Collections.Generic.Dictionary() diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs index 262b175df4a..79f27b1e5d9 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions #ObjectConstructors // Regression test for FSHARP1.0:3857 // Incorrect FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''a'. -// +// #light type X = diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs index 6615b0a4121..4fe0d1146c6 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs @@ -3,7 +3,7 @@ // FSB 1005, float comprehensions of form "x0 .. dx .. x1" suffer rounding errors // After changes in BigInt, this is no longer a warning. -//Floating point ranges are experimental and may be deprecated in a future release +//Floating point ranges are experimental and may be deprecated in a future release let floatingPointRange = [0.0 .. 0.01 .. 2.0] let lastNum, sndToLast = floatingPointRange diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs index 07e0c0093aa..2da3473a3e0 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4365 // Mistake in generation of code for disposal in "match" sequence expressions -// +// let r = ref 0 let f () = [ if (incr r; true) then yield! failwith "" ] let x = (try f () with Failure _ -> [!r]) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs index 7cb9fc6b0a0..217b182b9e2 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let p = [ (if true then [for i = 1 to 10 do yield i] // yield is not immediately under the 'then' branch, diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs index eeac39a5931..4d05174d69e 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let p = [ (if true then 1 else 2) ] (if p = [ 1 ] then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs index 7868329a4ff..516032657e7 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let y = [ if true then yield! [1;2] else () ] (if y = [1;2] then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs index 41214f29903..04dcf78f12a 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let x = [ if true then yield! [1] diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs index 3c9793e9ae5..5ce4014dd77 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:3135 // Usage of "->>" in a sequence expression is deprecated // Use "do yield! ..." instead -// +// #light let s = seq { for i in [1 .. 2] do yield! seq { yield i+1 } } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs index 0a149b1d29b..537141f6eae 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs @@ -3,7 +3,7 @@ // Usage of "->" in a sequence expression is deprecated, unless // in [ for pat in expr -> expr ] and other compact seq expr // Compile with --warnaserror -// +// #light let s1 = seq { for i in [ 1 .. 2 ] -> 10 } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs index e6f8bceff17..bc0876af1de 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:3135 // Usage of "->" in a sequence expression is deprecated, unless // in [ for pat in expr -> expr ] and other compact seq expr -// +// #light let s1 = seq { yield 10 } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx index d789557d0a0..9f1a449e249 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx @@ -6,7 +6,7 @@ // // rigid type annotation used in the a let-binding // -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx index 6db2cbfdc03..53811ad4000 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx @@ -6,7 +6,7 @@ // // rigid type annotation used in the a let-binding (function definition + function invocation) // -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx index b45dbc64fda..c42d7ac54a0 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx @@ -7,7 +7,7 @@ // expr : ty // // Misc test on 'null' -// +// #light let a = null : string diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx index ba26509d6ab..83a7153666b 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy -// +// #light type K1() = class diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx index 1af94c3923e..e86d044d685 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast to object - int -// +// #light let a = ( upcast 1 ) : obj let b = ( 1 :> _ ) : obj diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx index fde1b72d2fd..e8189cdb727 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy - cast to interface -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx index 8bb0edd84f1..2e896ef9c30 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx @@ -1,7 +1,7 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy - cast to interface // Interface is defined in the base class -> can still upcast to I -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx index 0355b0147f6..d65de19a9d2 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast to object - null -// +// #light let a = ( upcast null ) : obj let b = ( null :> _ ) : obj diff --git a/tests/fsharpqa/Source/Conformance/Expressions/test_Conformance_Expressions.fs b/tests/fsharpqa/Source/Conformance/Expressions/test_Conformance_Expressions.fs new file mode 100644 index 00000000000..8495d936086 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/Expressions/test_Conformance_Expressions.fs @@ -0,0 +1,177 @@ +module ``FSharpQA-Tests-Conformance-Expressions`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module ApplicationExpressions = + + module Assertion = + + [] + let Assertion () = runpl |> check + + module BasicApplication = + + [] + let BasicApplication () = runpl |> check + + module ObjectConstruction = + + [] + let ObjectConstruction () = runpl |> check + + +module BindingExpressions = + + [] + let BindingExpressions () = runpl |> check + + +module ConstantExpressions = + + [] + let ConstantExpressions () = runpl |> check + + +module ControlFlowExpressions = + + + module Assertion = + [] + let Assertion () = runpl |> check + + module Conditional = + [] + let Conditional () = runpl |> check + + module ParenthesizedAndBlock = + [] + let ParenthesizedAndBlock () = runpl |> check + + module PatternMatching = + [] + let PatternMatching () = runpl |> check + + module SequenceIteration = + [] + let SequenceIteration () = runpl |> check + + module SequentialExecution = + [] + let SequentialExecution () = runpl |> check + + module SimpleFor = + [] + let SimpleFor () = runpl |> check + + module TryCatch = + [] + let TryCatch () = runpl |> check + + module TryFinally = + [] + let TryFinally () = runpl |> check + + module While = + [] + let While () = runpl |> check + + +module DataExpressions = + + module AddressOf = + + [] + let AddressOf () = runpl |> check + + module ComputationExpressions = + + [] + let ComputationExpressions () = runpl |> check + + module ObjectExpressions = + + [] + let ObjectExpressions () = runpl |> check + + module QueryExpressions = + + [] + let QueryExpressions () = runpl |> check + + module RangeExpressions = + + [] + let RangeExpressions () = runpl |> check + + module SequenceExpressions = + + [] + let SequenceExpressions () = runpl |> check + + module Simple = + + [] + let Simple () = runpl |> check + + module TupleExpressions = + + [] + let TupleExpressions () = runpl |> check + +module ElaborationAndElaboratedExpressions = + + [] + let ElaborationAndElaboratedExpressions () = runpl |> check + + +module EvaluationAndValues = + + [] + let EvaluationAndValues () = runpl |> check + + +module EvaluationOfElaboratedForms = + + [] + let EvaluationOfElaboratedForms () = runpl |> check + + +module ExpressionQuotations = + + module Baselines = + + [] + let Baselines () = runpl |> check + + module Regressions = + + [] + let Regressions () = runpl |> check + + +module SomeCheckingAndInferenceTerminology = + + [] + let SomeCheckingAndInferenceTerminology () = runpl |> check + + +module SyntacticSugar = + + [] + let SyntacticSugar () = runpl |> check + + +module SyntacticSugarAndAmbiguities = + + [] + let SyntacticSugarAndAmbiguities () = runpl |> check + + +module TyperelatedExpressions = + + [] + let TyperelatedExpressions () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/CheckingOfImplementationFiles/env.lst b/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/CheckingOfImplementationFiles/env.lst index 40b335de60d..6c275f0cc89 100644 --- a/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/CheckingOfImplementationFiles/env.lst +++ b/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/CheckingOfImplementationFiles/env.lst @@ -1,6 +1,6 @@ - SOURCE=AbstractSlot01.fsi AbstractSlot01.fs # AbstractSlot01 - SOURCE=Properties01.fsi Properties01.fs # Properties01 - SOURCE=Properties02.fsi Properties02.fs # Properties02 + SOURCE="AbstractSlot01.fsi AbstractSlot01.fs" # AbstractSlot01 + SOURCE="Properties01.fsi Properties01.fs" # Properties01 + SOURCE="Properties02.fsi Properties02.fs" # Properties02 SOURCE="E_AnonSignatureFile.fsi E_AnonSignatureFile.fs" # E_AnonSignatureFile SOURCE="E-SignatureAfterSource.fs E-SignatureAfterSource.fsi" # E-SignatureAfterSource diff --git a/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/test_Conformance_ImplementationFilesAndSignatureFiles.fs b/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/test_Conformance_ImplementationFilesAndSignatureFiles.fs new file mode 100644 index 00000000000..d3e6a42f212 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/ImplementationFilesAndSignatureFiles/test_Conformance_ImplementationFilesAndSignatureFiles.fs @@ -0,0 +1,38 @@ +module ``FSharpQA-Tests-Conformance-ImplementationFilesAndSignatureFiles`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module CheckingOfImplementationFiles = + + [] + let CheckingOfImplementationFiles () = runpl |> check + + +module InitializationSemanticsForImplementationFiles = + + [] + let InitializationSemanticsForImplementationFiles () = runpl |> check + + +module NamespacesFragmentsAndImplementationFiles = + + module Basic = + + [] + let Basic () = runpl |> check + + module Global = + + [] + let Global () = runpl |> check + + +module SignatureFiles = + + [] + let SignatureFiles () = runpl |> check + diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs index eb5dcc1b987..97af65cbebd 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs @@ -1,6 +1,6 @@ // #Conformance #TypeInference // Verify error if you only specify some, but not all, type args -// +// let f<'a> x (y : 'a) = (x, y) // used to be error "Value restriction...". In Beta2, it is ok (val f : obj -> 'a -> obj * 'a) diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/test_Conformance_InferenceProcedures.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/test_Conformance_InferenceProcedures.fs new file mode 100644 index 00000000000..42fd5ae4ff2 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/test_Conformance_InferenceProcedures.fs @@ -0,0 +1,90 @@ +module ``FSharpQA-Tests-Conformance-InferenceProcedures`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module ByrefSafetyAnalysis = + + [] + let ByrefSafetyAnalysis () = runpl |> check + + +module ConstraintSolving = + + [] + let ConstraintSolving () = runpl |> check + + +module DispatchSlotChecking = + + [] + let DispatchSlotChecking () = runpl |> check + + +module DispatchSlotInference = + + [] + let DispatchSlotInference () = runpl |> check + + +module FunctionApplicationResolution = + + [] + let FunctionApplicationResolution () = runpl |> check + + +module Generalization = + + [] + let Generalization () = runpl |> check + + +module MethodApplicationResolution = + + [] + let MethodApplicationResolution () = runpl |> check + + +module NameResolution = + + module AutoOpen = + + [] + let AutoOpen () = runpl |> check + + module Misc = + + [] + let Misc () = runpl |> check + + module RequireQualifiedAccess = + + [] + let RequireQualifiedAccess () = runpl |> check + + +module RecursiveSafetyAnalysis = + + [] + let RecursiveSafetyAnalysis () = runpl |> check + + +module ResolvingApplicationExpressions = + + [] + let ResolvingApplicationExpressions () = runpl |> check + + +module TypeInference = + + [] + let TypeInference () = runpl |> check + + +module WellFormednessChecking = + + [] + let WellFormednessChecking () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs index 944e2270832..61b32dc9f2d 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // string embedded in a comment: malformed string // which yield to a compilation error -//End of file in string embedded in comment begun at or before here diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs index fa317a2ee2d..00265542dd4 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: invalid escape sequence // \s is not an escaped char, so it's the same as \\s -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs index 2370baad00e..d5250ec549d 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate string containing the // block-comment-end token -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs index 09e204dfdde..4931f43463c 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs @@ -1,6 +1,6 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate escape sequence -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs index 3491c92e104..88dc701d70e 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate escape sequence // A backslash in in the string -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs index f0a284920ba..622e431eeb2 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:945 // comment lexing does not handle \" inside quoted strings -// +// #light (* simple escape chars (escape-char in the grammar) *) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs index 742841694ca..4553f23c2b6 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:946 // comment lexing does not handle "" and \ inside @" strings -// +// #light (* @"\" *) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs index e3ce9f34794..91f98df0bf4 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs index e720d1e00a2..61a6c1ffc15 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y1 = (* This is a comment with (**) nested *) 0 exit (if y1 = 0 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs index 0d639e0121e..669873e81a9 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y2 = (* This is a comment with * nested *) 2 exit (if y2 = 2 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs index 11d0d3840b9..caa6e1fcdf3 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y3 = (* This is a comment with (* *) nested *) 3 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs index e6e7f3bffe8..68ece1a9eb6 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y4 = (* This is a comment with (** **) nested *) 4 exit (if y4 = 4 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs index ab1add1c779..1aaa55e3330 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y5= (* This is a comment with (***) nested *) 5 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs index 2c550ad3d3c..dc493031755 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs @@ -30,31 +30,31 @@ let trait = 10 let virtual = 10 let volatile = 10 -//The identifier 'atomic' is reserved for future use by F# -//The identifier 'break' is reserved for future use by F# -//The identifier 'checked' is reserved for future use by F# -//The identifier 'component' is reserved for future use by F# +//The identifier 'atomic' is reserved for future use by F# +//The identifier 'break' is reserved for future use by F# +//The identifier 'checked' is reserved for future use by F# +//The identifier 'component' is reserved for future use by F# -//The identifier 'constraint' is reserved for future use by F# -//The identifier 'constructor' is reserved for future use by F# -//The identifier 'continue' is reserved for future use by F# -//The identifier 'eager' is reserved for future use by F# -//The identifier 'fixed' is reserved for future use by F# -//The identifier 'fori' is reserved for future use by F# -//The identifier 'functor' is reserved for future use by F# -//The identifier 'include' is reserved for future use by F# -//The identifier 'method' is reserved for future use by F# -//The identifier 'measure' is reserved for future use by F# -//The identifier 'mixin' is reserved for future use by F# -//The identifier 'object' is reserved for future use by F# -//The identifier 'parallel' is reserved for future use by F# -//The identifier 'params' is reserved for future use by F# -//The identifier 'process' is reserved for future use by F# -//The identifier 'protected' is reserved for future use by F# -//The identifier 'pure' is reserved for future use by F# -//The identifier 'recursive' is reserved for future use by F# -//The identifier 'sealed' is reserved for future use by F# -//The identifier 'tailcall' is reserved for future use by F# -//The identifier 'trait' is reserved for future use by F# -//The identifier 'virtual' is reserved for future use by F# -//The identifier 'volatile' is reserved for future use by F# +//The identifier 'constraint' is reserved for future use by F# +//The identifier 'constructor' is reserved for future use by F# +//The identifier 'continue' is reserved for future use by F# +//The identifier 'eager' is reserved for future use by F# +//The identifier 'fixed' is reserved for future use by F# +//The identifier 'fori' is reserved for future use by F# +//The identifier 'functor' is reserved for future use by F# +//The identifier 'include' is reserved for future use by F# +//The identifier 'method' is reserved for future use by F# +//The identifier 'measure' is reserved for future use by F# +//The identifier 'mixin' is reserved for future use by F# +//The identifier 'object' is reserved for future use by F# +//The identifier 'parallel' is reserved for future use by F# +//The identifier 'params' is reserved for future use by F# +//The identifier 'process' is reserved for future use by F# +//The identifier 'protected' is reserved for future use by F# +//The identifier 'pure' is reserved for future use by F# +//The identifier 'recursive' is reserved for future use by F# +//The identifier 'sealed' is reserved for future use by F# +//The identifier 'tailcall' is reserved for future use by F# +//The identifier 'trait' is reserved for future use by F# +//The identifier 'virtual' is reserved for future use by F# +//The identifier 'volatile' is reserved for future use by F# diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx index b578bcded92..a546320d987 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx @@ -1,4 +1,4 @@ -// +// open System open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs index 08eecf28298..91ab16df814 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Bin -// +// #light let x1 = 0B1 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs index 406ac91d881..e5a7ca5ad86 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Float -// +// #light let x = 0x5 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs index 37f601ddeb8..3ab355ec10a 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier LF/lf are case sensitive // IEEE32/IEEE64 - lf vs LF -// +// #light let x = 0x5lf diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs index 5ae1d5e5446..25862389482 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs @@ -2,7 +2,7 @@ // Number type specifier are not case sensitive // IEEE32/IEEE64 - lf vs LF // verify that xint can be specified either with '0x' or '0X' -// +// #light let x = 0X5LF diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs index 960047eaf0d..dbd648a4f56 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Oct -// +// #light let x = 0o7 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs index bff2323485f..251673d2e07 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs @@ -2,7 +2,7 @@ // Regression test for FSharp1.0#1076 // Usage of >> and . // No spaces between >> and . -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs index 4dd9cab1ee3..ec1187fbd79 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs @@ -2,7 +2,7 @@ // Regression test for FSharp1.0#1076 // Usage of >> and . // 1 space >> and . -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs index aa7d7b4ff6e..c3e190dba0f 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2193 // Unicodegraph-long not in parity with C# -// +// #light let some_unicode_char = '\u00D6' diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs index d41170617de..12a6671e882 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs index 4370c474a37..5af95e05e46 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs index 62b007acc27..ed3f5860e8a 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs index 2ebfa5c841e..0065830c2a9 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs index 5476699dca2..6aff7f10196 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs index 638c6f267b8..7f23ee0d1e3 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs index fdd9d2158b7..2c542fd8ea4 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs index 00e96083226..76e31e183ca 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs index dc948a4e44d..1333d1c115f 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis #Operators // Regression test for FSHARP1.0:1392 // Space should not be required between : and > -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs index 4936e4123a3..e90463c36ca 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis #Operators // Regression test for FSHARP1.0:1392 // Space should not be required between : and > -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/test_Conformance_LexicalAnalysis.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/test_Conformance_LexicalAnalysis.fs new file mode 100644 index 00000000000..80549c5d528 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/test_Conformance_LexicalAnalysis.fs @@ -0,0 +1,83 @@ +module ``FSharpQA-Tests-Conformance-LexicalAnalysis`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module Comments = + + [] + let Comments () = runpl |> check + + +module ConditionalCompilation = + + [] + let ConditionalCompilation () = runpl |> check + + +module Directives = + + [] + let Directives () = runpl |> check + + +module HiddenTokens = + + [] + let HiddenTokens () = runpl |> check + + +module IdentifierReplacements = + + [] + let IdentifierReplacements () = runpl |> check + + +module IdentifiersAndKeywords = + + [] + let IdentifiersAndKeywords () = runpl |> check + + +module LineDirectives = + + [] + let LineDirectives () = runpl |> check + + +module NumericLiterals = + + [] + let NumericLiterals () = runpl |> check + + +module Shift = + + [] + let Generics () = runpl |> check + + +module StringsAndCharacters = + + [] + let StringsAndCharacters () = runpl |> check + + +module SymbolicKeywords = + + [] + let SymbolicKeywords () = runpl |> check + + +module SymbolicOperators = + + [] + let SymbolicOperators () = runpl |> check + + +module Whitespace = + + [] + let Whitespace () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs index fdd58db8d43..b7327e1bc27 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs @@ -3,7 +3,7 @@ // FSB 1624, LexFilter should consifer infix tokens according to their length -// +// let x = 3 let y = x diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs index f60fbcf281a..5533778e40f 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The #light is now the default. See also FSHARP1.0:2319 -//#light +//#light //Main module of program is empty: nothing will happen when it is run diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs index f276b3a87e3..379ba736e68 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexFilter #ReqNOMT // Regression test for FSHARP1.0:1078 // The #light is default in fsi.exe -// +// let SimpleSample() = let x = 10 + 12 - 3 let y = x * 2 + 1 diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs index 9d33a8618ca..d06c07211db 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs @@ -1,5 +1,5 @@ // #Conformance #LexFilter #ReqNOMT -//#light +//#light module TestModule let SimpleSample() = let x = 10 + 12 - 3 diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs index 7a313d434fa..6ba9a667f22 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The opposit of #light is (for now) #indent "off" -// +// #indent "off" module M let SimpleSample() = diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs index 43a8ed0a290..2c75e5f8ec9 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The #light is (for now) #indent "off" -// +// #light "off" exit 0;; diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs index 35c40129de1..1f99b86cf56 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter #Precedence #ReqNOMT // Regression test for FSHARP1.0:4161 - Error when trying to lex/parse a range involving biggest negative number -// +// module TestModule diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx index 2abd0fa9735..37430667b75 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter #Precedence #ReqNOMT // Regression test for FSHARP1.0:4161 - Error when trying to lex/parse a range involving biggest negative number -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/test_Conformance_LexicalFiltering.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/test_Conformance_LexicalFiltering.fs new file mode 100644 index 00000000000..b57ec072a50 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/test_Conformance_LexicalFiltering.fs @@ -0,0 +1,33 @@ +module ``FSharpQA-Tests-Conformance-LexicalFiltering`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module Basic = + + [] + let ByExample () = runpl |> check + + [] + let OffsideExceptions () = runpl |> check + + +module HashLight = + + [] + let HashLight () = runpl |> check + + +module HighPrecedenceApplication = + + [] + let HighPrecedenceApplication () = runpl |> check + + +module LexicalAnalysisOfTypeApplications = + + [] + let LexicalAnalysisOfTypeApplications () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs index a92ede8e7ae..5193bdba68e 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #Classes #Inheritance // Regression test for FSHARP1.0:3929 // Impossible to subclass certain C# classes -// +// #light type Bottom() = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx index c6b60e50871..bee58b466ff 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx @@ -1,6 +1,6 @@ // #Regression #Conformance #ObjectOrientedTypes #Classes #Inheritance // Regression test DevDiv:370485 ([Portable] Cannot override sealed method) -// +// // This is the repro case for the bug. There should be no error. type T1() = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs index cda8b5087a2..0ca40dc39c3 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Classes #LetBindings // Scoping: // identifier introduced by let is local -// +// #light type C() = class static let mutable m = [1;2;3] diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs index 22b1a7f557a..bd89ddbb5a1 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs @@ -2,7 +2,7 @@ // Offside rule for static let // We should start counting from the 'static' not from 'let' // Regression test for FSHARP1.0:2042 -// +// #light type T() = static let foo baz = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs index debbdcb429d..43fdce499d2 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #LetBindings // rec (non-mutable) -// +// #light type C() = class static let rec f a = if a = 0 then 1 else a*f(a-1) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs index ef33bb87fb7..18e7e81d0ab 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Delegates // Delegate taking multiple arguments // Declaration is in the form: typ * ... * typ -> typ -// +// // Non-generic type MultiArgDelegate = delegate of int * string * byte -> unit diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs index 8e5dda697e7..629659fad76 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Delegates // Delegate returning a function value // Declaration is in the form: typ -> (typ -> ... -> typ -> typ) -// +// // Non-generic type DelegateReturningAFunctionValue = delegate of int -> (string -> int) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs index 528b0c9caa6..c420de39e11 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:5540 // See also FSHARP1.0:5597 // It is forbidden to implement an interface at multiple instantiations -// +//Duplicate specification of an interface$ //Duplicate or redundant interface$ //Duplicate or redundant interface$ //No abstract or interface member was found that corresponds to this override$ diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs index 1abe9c7206e..c8771146df5 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #Structs // Verify error when trying to inherit from a struct type // Regression test for FSHARP1.0:2803 -//FS0191: Cannot inherit from interface type +//FS0191: Cannot inherit from interface type //Cannot inherit a sealed type diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs index ba7ef290a7a..ae191b89c89 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #ObjectOrientedTypes #Structs // Regression test for FSHARP1.0:3051 -// +// module TestModule [] diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/Experiment.cs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/Experiment.cs index 965b06eee7e..fefcdbf39b0 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/Experiment.cs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/Experiment.cs @@ -1,6 +1,6 @@ // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// namespace Experiment { diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs index d831cb584ee..1f668e8eec1 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs @@ -3,7 +3,7 @@ // conflicting members. // After recent changes, DoStuff are no longed intrinsic members; they are instead // extension methods... so this code compiles just fine. -// +// #light namespace NS diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs index 35a34ad8112..257d8d94141 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Extension diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi index d21fdb3e9d9..fa0488311a8 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Extension diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs index cf998c11080..397011cbb52 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Test diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs index 620ed72e812..65dab9bc7c6 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3593 // "Prefer extension members that have been brought into scope by more recent "open" statements" -// +// namespace NS module M = type Lib with diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/test_Conformance_ObjectOrientedTypeDefinitions.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/test_Conformance_ObjectOrientedTypeDefinitions.fs new file mode 100644 index 00000000000..6d914151e5f --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/test_Conformance_ObjectOrientedTypeDefinitions.fs @@ -0,0 +1,120 @@ +module ``FSharpQA-Tests-Conformance-ObjectOrientedTypeDefinitions`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + + +module AbstractMembers = + + [] + let AbstractMembers () = runpl |> check + + +module ClassTypes = + + module AsDeclarations = + + [] + let AsDeclarations () = runpl |> check + + module AutoProperties = + + [] + let AutoProperties () = runpl |> check + + module ExplicitFields = + + [] + let ExplicitFields () = runpl |> check + + module ExplicitObjectConstructors = + + [] + let ExplicitObjectConstructors () = runpl |> check + + module ImplicitObjectConstructors = + + [] + let ImplicitObjectConstructors () = runpl |> check + + module InheritsDeclarations = + + [] + let InheritsDeclarations () = runpl |> check + + module LetDoDeclarations = + + [] + let LetDoDeclarations () = runpl |> check + + module MemberDeclarations = + + [] + let MemberDeclarations () = runpl |> check + + module Misc = + + [] + let Misc () = runpl |> check + + module StaticLetDoDeclarations = + + [] + let StaticLetDoDeclarations () = runpl |> check + + module ValueRestriction = + + [] + let ValueRestriction () = runpl |> check + + +module DelegateTypes = + + [] + let DelegateTypes () = runpl |> check + + +module EnumTypes = + + [] + let EnumTypes () = runpl |> check + + +module InterfaceTypes = + + [] + let InterfaceTypes () = runpl |> check + + +module StructTypes = + + [] + let StructTypes () = runpl |> check + + + +module TypeExtensions = + + module basic = + + [] + let basic () = runpl |> check + + module intrinsic = + + [] + let intrinsic () = runpl |> check + + module optional = + + [] + let optional () = runpl |> check + + +module TypeKindInference = + + [] + let TypeKindInference () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/test_Conformance_PatternMatching.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/test_Conformance_PatternMatching.fs new file mode 100644 index 00000000000..8d47ee60482 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/test_Conformance_PatternMatching.fs @@ -0,0 +1,101 @@ +module ``FSharpQA-Tests-Conformance-PatternMatching`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module And = + + [] + let And () = runpl |> check + + +module Array = + + [] + let Array () = runpl |> check + + +module As = + + [] + let As () = runpl |> check + + +module ConsList = + + [] + let ConsList () = runpl |> check + + +module DynamicTypeTest = + + [] + let DynamicTypeTest () = runpl |> check + + +module Expression = + + [] + let Expression () = runpl |> check + + +module Named = + + [] + let Named () = runpl |> check + + +module Null = + + [] + let Null () = runpl |> check + + +module Record = + + [] + let Record () = runpl |> check + + +module Simple = + + [] + let Simple () = runpl |> check + + +module SimpleConstant = + + [] + let SimpleConstant () = runpl |> check + + +module Tuple = + + [] + let Tuple () = runpl |> check + + +module TypeAnnotated = + + [] + let TypeAnnotated () = runpl |> check + + +module TypeConstraint = + + [] + let TypeConstraint () = runpl |> check + + +module Union = + + [] + let Union () = runpl |> check + + +module Wildcard = + + [] + let Wildcard () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi b/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi index 7c9b851e897..991c81ee5b4 100644 --- a/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi +++ b/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi @@ -1,6 +1,6 @@ // #Conformance #Signatures #Structs #Regression // Regression for Dev11:137930, structs used to not give errors on unimplemented constructors in the signature file -//Module 'M' requires a value 'new : unit -> Foo<'T>' +//Module 'M' requires a value 'new : unit -> Foo<'T>' module M diff --git a/tests/fsharpqa/Source/Conformance/Signatures/test_Conformance_Signatures.fs b/tests/fsharpqa/Source/Conformance/Signatures/test_Conformance_Signatures.fs new file mode 100644 index 00000000000..734e72c6158 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/Signatures/test_Conformance_Signatures.fs @@ -0,0 +1,18 @@ +module ``FSharpQA-Tests-Conformance-Signatures`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module SignatureConformance = + + [] + let SignatureConformance () = runpl |> check + + +module SignatureTypes = + + [] + let SignatureTypes () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/System.ThreadStatic/W_Deprecated01.fs b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/System.ThreadStatic/W_Deprecated01.fs index fab0d7f9e46..c15f3060016 100644 --- a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/System.ThreadStatic/W_Deprecated01.fs +++ b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/System.ThreadStatic/W_Deprecated01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #Attributes // Regression test for FSHARP1.0:4226 // We want to make sure the warning emits the correct suggestion (val and mutable were swapped) -//Thread static and context static 'let' bindings are deprecated\. Instead use a declaration of the form 'static val mutable : ' in a class\. Add the 'DefaultValue' attribute to this declaration to indicate that the value is initialized to the default value on each new thread\.$ +//Thread static and context static 'let' bindings are deprecated\. Instead use a declaration of the form 'static val mutable : ' in a class\. Add the 'DefaultValue' attribute to this declaration to indicate that the value is initialized to the default value on each new thread\.$ module M module Foo = [] diff --git a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/test_Conformance_SpecialAttributesAndTypes.fs b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/test_Conformance_SpecialAttributesAndTypes.fs new file mode 100644 index 00000000000..e21fe5922c3 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/test_Conformance_SpecialAttributesAndTypes.fs @@ -0,0 +1,11 @@ +module ``FSharpQA-Tests-Conformance-SpecialAttributesAndTypes`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module Imported = + + [] + let SystemThreadStatic () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/Class/env.lst b/tests/fsharpqa/Source/Conformance/TypeForwarding/Class/env.lst index fd3e6ae4bde..231ee742a03 100644 --- a/tests/fsharpqa/Source/Conformance/TypeForwarding/Class/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/Class/env.lst @@ -16,76 +16,76 @@ ############################################################## ######## non-generic type forwarding test - SOURCE=NG_NormalClass.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # NG_NormalClassNoTypeFwd + SOURCE=NG_NormalClass.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # NG_NormalClassNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat NG_NormalClass.exe" # NG_NormalClassWithTypeFwd - SOURCE=NG_MethodParam.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # NG_MethodParamNoTypeFwd + SOURCE=NG_MethodParam.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # NG_MethodParamNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat NG_MethodParam.exe" # NG_MethodParamWithTypeFwd - SOURCE=NG_WidenAccess.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # NG_WidenAccessNoTypeFwd + SOURCE=NG_WidenAccess.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # NG_WidenAccessNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat NG_WidenAccess.exe" # NG_WidenAccessWithTypeFwd - SOURCE=NG_TurnToStruct.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # NG_TurnToStructNoTypeFwd + SOURCE=NG_TurnToStruct.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # NG_TurnToStructNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat NG_TurnToStruct.exe NG_TurnToStruct_x86_ExpErr.txt NG_TurnToStruct_64_ExpErr.txt" # NG_TurnToStructWithTypeFwd ############################################################### ######## method of generic test - SOURCE=G_Method001.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_Method001NoTypeFwd + SOURCE=G_Method001.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_Method001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Method001.exe G_Method001_x86_ExpErr.txt G_Method001_64_ExpErr.txt" # G_Method001WithTypeFwd - SOURCE=G_Method002.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_Method002NoTypeFwd + SOURCE=G_Method002.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_Method002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_Method002.exe" # G_Method002WithTypeFwd ############################################################### ######## generic interface - SOURCE=G_Interface001.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_Interface001NoTypeFwd + SOURCE=G_Interface001.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_Interface001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_Interface001.exe" # G_Interface001WithTypeFwd - SOURCE=G_Interface002.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_Interface002NoTypeFwd + SOURCE=G_Interface002.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_Interface002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Interface002.exe G_Interface002_x86_ExpErr.txt G_Interface002_64_ExpErr.txt" # G_Interface002WithTypeFwd ############################################################### #### constraint - SOURCE=G_Constraint001.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint001NoTypeFwd + SOURCE=G_Constraint001.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_constraint001.exe" # G_constraint001WithTypeFwd - SOURCE=G_Constraint002.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint002NoTypeFwd + SOURCE=G_Constraint002.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Method001.exe G_Constraint002_x86_ExpErr.txt G_Constraint002_64_ExpErr.txt" # G_constraint002WithTypeFwd - SOURCE=G_Constraint003.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint003NoTypeFwd + SOURCE=G_Constraint003.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint003NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_constraint003.exe" # G_constraint003WithTypeFwd - SOURCE=G_Constraint004.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint004NoTypeFwd + SOURCE=G_Constraint004.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint004NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_constraint004.exe" # G_constraint004WithTypeFwd - SOURCE=G_Constraint005.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint005NoTypeFwd + SOURCE=G_Constraint005.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint005NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_constraint005.exe" # G_constraint005WithTypeFwd - SOURCE=G_Constraint006.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint006NoTypeFwd + SOURCE=G_Constraint006.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_constraint006NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Constraint006.exe G_Constraint006_x86_ExpErr.txt G_Constraint006_64_ExpErr.txt" # G_constraint006WithTypeFwd ############################################################### #### basic generic type forwarding test - SOURCE=G_Basic001.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic001NoTypeFwd + SOURCE=G_Basic001.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic001.exe" # G_basic001WithTypeFwd - SOURCE=G_Basic002.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic002NoTypeFwd + SOURCE=G_Basic002.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Basic002.exe G_Basic002_x86_ExpErr.txt G_Basic002_64_ExpErr.txt" # G_basic002WithTypeFwd - SOURCE=G_Basic003.fs PRECMD="csc /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic003NoTypeFwd + SOURCE=G_Basic003.fs PRECMD="\$CSC_PIPE /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic003NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic003.exe" # G_basic003WithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004A /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004aNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004A /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004aNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004aWithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004B /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004bNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004B /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004bNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004bWithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004C /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004cNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004C /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004cNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004cWithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004D /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004dNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004D /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004dNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004dWithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004E /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004eNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004E /t:library Class_Library.cs" SCFLAGS="--reference:Class_Library.dll" # G_basic004eNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004eWithTypeFwd \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/BuildAssembly.bat b/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/BuildAssembly.bat index 309042137e3..23073dc8198 100644 --- a/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/BuildAssembly.bat +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/BuildAssembly.bat @@ -11,6 +11,7 @@ goto Exit csc /define:BASIC001A /t:library /out:Cycle_Forward001a.dll Cycle_Forwarder.cs csc /define:BASIC001B /t:library /out:Cycle_Forward001b.dll Cycle_Forwarder.cs csc /define:FORWARD /t:library /r:Cycle_forward001a.dll /r:Cycle_forward001b.dll Cycle_Library.cs +goto Exit :002a csc /define:BASIC002A /t:library /out:Cycle_Forward002a.dll Cycle_Forwarder.cs diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/BuildAssembly.bat.fs b/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/BuildAssembly.bat.fs new file mode 100644 index 00000000000..942583e69a8 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/BuildAssembly.bat.fs @@ -0,0 +1,94 @@ +module ``Conformance-TypeForwarding-Cycle-BuildAssembly`` + +open NUnit.Framework + +open NUnitConf +open PlatformHelpers +open System.IO + + + +let run arg1 cwd (cfg: RunPl.RunPlConfig) = attempt { + + let exec p = Command.exec cwd cfg.envVars { Output = Inherit; Input = None} p >> checkResult + let csc = Commands.csc exec cfg.CSC_PIPE + + // :001 + let label001 = attempt { + // csc /define:BASIC001A /t:library /out:Cycle_Forward001a.dll Cycle_Forwarder.cs + do! csc "/define:BASIC001A /t:library /out:Cycle_Forward001a.dll" [ "Cycle_Forwarder.cs" ] + + // csc /define:BASIC001B /t:library /out:Cycle_Forward001b.dll Cycle_Forwarder.cs + do! csc "/define:BASIC001B /t:library /out:Cycle_Forward001b.dll" [ "Cycle_Forwarder.cs" ] + + // csc /define:FORWARD /t:library /r:Cycle_forward001a.dll /r:Cycle_forward001b.dll Cycle_Library.cs + do! csc "/define:FORWARD /t:library /r:Cycle_forward001a.dll /r:Cycle_forward001b.dll" [ "Cycle_Library.cs" ] + } + + // :002a + let label002a = attempt { + // csc /define:BASIC002A /t:library /out:Cycle_Forward002a.dll Cycle_Forwarder.cs + do! csc "/define:BASIC002A /t:library /out:Cycle_Forward002a.dll" [ "Cycle_Forwarder.cs" ] + // csc /define:FORWARD /t:library /r:Cycle_Forward002a.dll Cycle_Library.cs + do! csc "/define:FORWARD /t:library /r:Cycle_Forward002a.dll" [ "Cycle_Library.cs" ] + // goto Exit + } + + // :002b + let label002b = attempt { + // csc /define:BASIC002A /t:library /out:Cycle_Forward002a.dll Cycle_Forwarder.cs + do! csc "/define:BASIC002A /t:library /out:Cycle_Forward002a.dll" [ "Cycle_Forwarder.cs" ] + // csc /define:FORWARD /t:library /r:Cycle_Forward002a.dll Cycle_Library.cs + do! csc "/define:FORWARD /t:library /r:Cycle_Forward002a.dll" [ "Cycle_Library.cs" ] + + // csc /define:BASIC002B /t:library /out:Cycle_Forward002b.dll Cycle_Forwarder.cs + do! csc "/define:BASIC002B /t:library /out:Cycle_Forward002b.dll" [ "Cycle_Forwarder.cs" ] + // csc /define:FORWARDFOO /t:library /r:Cycle_Forward002b.dll Cycle_Forwarder.cs + do! csc "/define:FORWARDFOO /t:library /r:Cycle_Forward002b.dll" [ "Cycle_Forwarder.cs" ] + // goto Exit + } + + // :003 + let label003 = attempt { + // csc /t:library /out:cycle_library003.dll cycle_library003.cs + do! csc "/t:library /out:cycle_library003.dll" [ "cycle_library003.cs" ] + // csc /define:BASIC003B /t:library /r:cycle_library003.dll /out:Cycle_Forward003b.dll Cycle_Forwarder.cs + do! csc "/define:BASIC003B /t:library /r:cycle_library003.dll /out:Cycle_Forward003b.dll" [ "Cycle_Forwarder.cs" ] + // csc /define:BASIC003A /t:library /r:cycle_forward003b.dll /r:cycle_library003.dll /out:Cycle_Forward003a.dll Cycle_Forwarder.cs + do! csc "/define:BASIC003A /t:library /r:cycle_forward003b.dll /r:cycle_library003.dll /out:Cycle_Forward003a.dll" [ "Cycle_Forwarder.cs" ] + // csc /define:FORWARD /t:library /r:cycle_forward003a.dll /r:cycle_forward003b.dll /out:cycle_library003.dll cycle_library003.cs + do! csc "/define:FORWARD /t:library /r:cycle_forward003a.dll /r:cycle_forward003b.dll /out:cycle_library003.dll" [ "cycle_library003.cs" ] + // goto Exit + } + + // :004 + let label004 = attempt { + // csc /define:BASIC004A /t:library /out:Cycle_Forward004a.dll Cycle_Forwarder.cs + do! csc "/define:BASIC004A /t:library /out:Cycle_Forward004a.dll" [ "Cycle_Forwarder.cs" ] + // csc /define:BASIC004B /t:library /out:Cycle_Forward004b.dll Cycle_Forwarder.cs + do! csc "/define:BASIC004B /t:library /out:Cycle_Forward004b.dll" [ "Cycle_Forwarder.cs" ] + // csc /define:FORWARD /t:library /r:cycle_forward004a.dll Cycle_Library.cs + do! csc "/define:FORWARD /t:library /r:cycle_forward004a.dll" [ "Cycle_Library.cs" ] + // goto Exit + } + + + + // @echo off + ignore "useless" + + return! match arg1 with + // if %1 == 001 goto 001 + | "001" -> label001 + // if %1 == 002a goto 002a + | "002a" -> label002a + // if %1 == 002b goto 002b + | "002b" -> label002b + // if %1 == 003 goto 003 + | "003" -> label003 + // if %1 == 004 goto 004 + | "004" -> label004 + // goto Exit + //:Exit + | a -> NUnitConf.genericError (sprintf "arg %s not implemented" a) + } diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/env.lst b/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/env.lst index 5a97c498f7c..25f7de5ea9c 100644 --- a/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/Cycle/env.lst @@ -9,19 +9,19 @@ ## checkForward.bat -- script file to check that we got the expected exit code ## ########################################################################################################################################################################################## - SOURCE=Cycle001.fs PRECMD="csc /t:library Cycle_Library.cs" SCFLAGS="--reference:Cycle_Library.dll" # Cycle001NoTypeFwd + SOURCE=Cycle001.fs PRECMD="\$CSC_PIPE /t:library Cycle_Library.cs" SCFLAGS="--reference:Cycle_Library.dll" # Cycle001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat 001" POSTCMD="checkForward.bat Cycle001.exe" # Cycle001WithTypeFwd - SOURCE=Cycle002.fs PRECMD="csc /t:library Cycle_Library.cs" SCFLAGS="--reference:Cycle_Library.dll" # Cycle002NoTypeFwd + SOURCE=Cycle002.fs PRECMD="\$CSC_PIPE /t:library Cycle_Library.cs" SCFLAGS="--reference:Cycle_Library.dll" # Cycle002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat 002a" POSTCMD="checkForward.bat Cycle002.exe" # Cycle002AWithTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat 002b" POSTCMD="checkForward.bat Cycle002.exe" # Cycle002BWithTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat 003" # CycleForwarding - SOURCE=Cycle004.fs PRECMD="csc /t:library Cycle_Library.cs" SCFLAGS="--reference:Cycle_Library.dll" # Cycle004NoTypeFwd + SOURCE=Cycle004.fs PRECMD="\$CSC_PIPE /t:library Cycle_Library.cs" SCFLAGS="--reference:Cycle_Library.dll" # Cycle004NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat 004" POSTCMD="checkForward.bat Cycle004.exe -4" # Cycle004WithTypeFwd00a - SOURCE=Dummy.fs PRECMD="csc /t:library /define:BASIC004A /r:cycle_forward004b.dll Cycle_Forwarder.cs" POSTCMD="checkForward.bat Cycle004.exe -4" # Cycle004WithTypeFwd00b - SOURCE=Dummy.fs PRECMD="csc /t:library /define:BASIC004B /r:cycle_forward004a.dll Cycle_Forwarder.cs" POSTCMD="checkForward.bat Cycle004.exe -4" # Cycle004WithTypeFwd00c + SOURCE=Dummy.fs PRECMD="\$CSC_PIPE /t:library /define:BASIC004A /r:cycle_forward004b.dll Cycle_Forwarder.cs" POSTCMD="checkForward.bat Cycle004.exe -4" # Cycle004WithTypeFwd00b + SOURCE=Dummy.fs PRECMD="\$CSC_PIPE /t:library /define:BASIC004B /r:cycle_forward004a.dll Cycle_Forwarder.cs" POSTCMD="checkForward.bat Cycle004.exe -4" # Cycle004WithTypeFwd00c \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/Delegate/env.lst b/tests/fsharpqa/Source/Conformance/TypeForwarding/Delegate/env.lst index cfde85d19e7..0f6e8c0d8e8 100644 --- a/tests/fsharpqa/Source/Conformance/TypeForwarding/Delegate/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/Delegate/env.lst @@ -13,27 +13,27 @@ ##################################################################### #### non generic test - SOURCE=NG_NormalDelegate.fs PRECMD="csc /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # NG_NormalDelegateNoTypeFwd + SOURCE=NG_NormalDelegate.fs PRECMD="\$CSC_PIPE /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # NG_NormalDelegateNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="NG_NormalDelegate.exe" # NG_NormalDelegateWithTypeFwd - SOURCE=NG_MethodParam.fs PRECMD="csc /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # NG_MethodParamNoTypeFwd + SOURCE=NG_MethodParam.fs PRECMD="\$CSC_PIPE /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # NG_MethodParamNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="NG_MethodParam.exe" # NG_MethodParamWithTypeFwd - SOURCE=NG_WidenAccess.fs PRECMD="csc /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # NG_WidenAccessNoTypeFwd + SOURCE=NG_WidenAccess.fs PRECMD="\$CSC_PIPE /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # NG_WidenAccessNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="NG_WidenAccess.exe" # NG_WidenAccessWithTypeFwd - SOURCE=NG_TurnToClass.fs PRECMD="csc /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # NG_TurnToClassNoTypeFwd + SOURCE=NG_TurnToClass.fs PRECMD="\$CSC_PIPE /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # NG_TurnToClassNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="recomp /p:NG_TurnToClass.exe /ee:NG_TurnToClass_ExpErr.txt" # NG_TurnToClassWithTypeFwd ##################################################################### #### basic generic test - SOURCE=G_Basic001.fs PRECMD="csc /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # G_basic001NoTypeFwd + SOURCE=G_Basic001.fs PRECMD="\$CSC_PIPE /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # G_basic001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="G_basic001.exe" # G_basic001WithTypeFwd - SOURCE=G_Basic002.fs PRECMD="csc /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # G_basic002NoTypeFwd + SOURCE=G_Basic002.fs PRECMD="\$CSC_PIPE /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # G_basic002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="recomp /p:G_Basic002.exe /ee:G_Basic002_ExpErr.txt" # G_basic002WithTypeFwd - SOURCE=G_Basic003.fs PRECMD="csc /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # G_basic003NoTypeFwd + SOURCE=G_Basic003.fs PRECMD="\$CSC_PIPE /t:library Delegate_Library.cs" SCFLAGS="--reference:Delegate_Library.dll" # G_basic003NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="G_basic003.exe" # G_basic003WithTypeFwd \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/Interface/env.lst b/tests/fsharpqa/Source/Conformance/TypeForwarding/Interface/env.lst index bb91de19458..90752f00bfb 100644 --- a/tests/fsharpqa/Source/Conformance/TypeForwarding/Interface/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/Interface/env.lst @@ -12,32 +12,32 @@ ############################################################## ######## non-generic type forwarding test - SOURCE=NG_NormalInterface.fs PRECMD="csc /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # NG_NormalInterfaceNoTypeFwd + SOURCE=NG_NormalInterface.fs PRECMD="\$CSC_PIPE /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # NG_NormalInterfaceNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="NG_NormalInterface.exe" # NG_NormalInterfaceWithTypeFwd - SOURCE=NG_MethodParam.fs PRECMD="csc /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # NG_MethodParamNoTypeFwd + SOURCE=NG_MethodParam.fs PRECMD="\$CSC_PIPE /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # NG_MethodParamNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="NG_MethodParam.exe" # NG_MethodParamWithTypeFwd - SOURCE=NG_WidenAccess.fs PRECMD="csc /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # NG_WidenAccessNoTypeFwd + SOURCE=NG_WidenAccess.fs PRECMD="\$CSC_PIPE /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # NG_WidenAccessNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="NG_WidenAccess.exe" # NG_WidenAccessWithTypeFwd - SOURCE=NG_TurnToClass.fs PRECMD="csc /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # NG_TurnToClassNoTypeFwd + SOURCE=NG_TurnToClass.fs PRECMD="\$CSC_PIPE /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # NG_TurnToClassNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="NG_TurnToClass.exe" # NG_TurnToClassWithTypeFwd ############################################################### ######## method of generic test - SOURCE=G_Method001.fs PRECMD="csc /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # G_Method001NoTypeFwd + SOURCE=G_Method001.fs PRECMD="\$CSC_PIPE /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # G_Method001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="G_Method001.exe" # G_Method001WithTypeFwd - SOURCE=G_Method002.fs PRECMD="csc /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # G_Method002NoTypeFwd + SOURCE=G_Method002.fs PRECMD="\$CSC_PIPE /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # G_Method002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="G_Method002.exe" # G_Method002WithTypeFwd ############################################################### #### basic generic type forwarding test - SOURCE=G_Basic001.fs PRECMD="csc /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # G_basic001NoTypeFwd + SOURCE=G_Basic001.fs PRECMD="\$CSC_PIPE /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # G_basic001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="G_basic001.exe" # G_basic001WithTypeFwd - SOURCE=G_Basic002.fs PRECMD="csc /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # G_Basic002NoTypeFwd + SOURCE=G_Basic002.fs PRECMD="\$CSC_PIPE /t:library Interface_Library.cs" SCFLAGS="--reference:Interface_Library.dll" # G_Basic002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="G_Basic002.exe" # G_Basic002WithTypeFwd \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/Nested/env.lst b/tests/fsharpqa/Source/Conformance/TypeForwarding/Nested/env.lst index 58c4eb14878..be66208bff1 100644 --- a/tests/fsharpqa/Source/Conformance/TypeForwarding/Nested/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/Nested/env.lst @@ -11,25 +11,25 @@ ############################################################## ######## non-generic type forwarding test - SOURCE=Nested001.fs PRECMD="csc /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested001NoTypeFwd + SOURCE=Nested001.fs PRECMD="\$CSC_PIPE /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildCSharp.bat Nested" POSTCMD="checkForward.bat Nested001.exe" # Nested001WithTypeFwd - SOURCE=Nested002.fs PRECMD="csc /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested002NoTypeFwd + SOURCE=Nested002.fs PRECMD="\$CSC_PIPE /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildCSharp.bat Nested" POSTCMD="checkForward.bat Nested002.exe" # Nested002WithTypeFwd - SOURCE=Nested002b.fs PRECMD="csc /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested002bNoTypeFwd + SOURCE=Nested002b.fs PRECMD="\$CSC_PIPE /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested002bNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildCSharp.bat Nested" POSTCMD="checkForward.bat Nested002b.exe" # Nested002bWithTypeFwd - SOURCE=Nested003.fs PRECMD="csc /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested003NoTypeFwd + SOURCE=Nested003.fs PRECMD="\$CSC_PIPE /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested003NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildCSharp.bat Nested" POSTCMD="checkForward.bat Nested003.exe" # Nested003WithTypeFwd - SOURCE=Nested003b.fs PRECMD="csc /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested003bNoTypeFwd + SOURCE=Nested003b.fs PRECMD="\$CSC_PIPE /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested003bNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildCSharp.bat Nested" POSTCMD="checkForward.bat Nested003b.exe" # Nested003bWithTypeFwd - SOURCE=Nested004.fs PRECMD="csc /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested004NoTypeFwd + SOURCE=Nested004.fs PRECMD="\$CSC_PIPE /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested004NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildCSharp.bat Nested" POSTCMD="checkForward.bat Nested004.exe" # Nested004WithTypeFwd - SOURCE=Nested004b.fs PRECMD="csc /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested004bNoTypeFwd + SOURCE=Nested004b.fs PRECMD="\$CSC_PIPE /t:library Nested_Library.cs" SCFLAGS="--reference:Nested_Library.dll" # Nested004bNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildCSharp.bat Nested" POSTCMD="checkForward.bat Nested004b.exe" # Nested004bWithTypeFwd SOURCE=Nested_ClassDeclaration.fs SCFLAGS="-r:System.Core.dll" # Nested_ClassDeclaration \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/Struct/env.lst b/tests/fsharpqa/Source/Conformance/TypeForwarding/Struct/env.lst index 602d8bd42e3..e7accf52fd8 100644 --- a/tests/fsharpqa/Source/Conformance/TypeForwarding/Struct/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/Struct/env.lst @@ -12,63 +12,63 @@ ############################################################## ######## non-generic type forwarding test - SOURCE=NG_NormalStruct.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # NG_NormalStructNoTypeFwd + SOURCE=NG_NormalStruct.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # NG_NormalStructNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat NG_NormalStruct.exe" # NG_NormalStructWithTypeFwd - SOURCE=NG_MethodParam.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # NG_MethodParamNoTypeFwd + SOURCE=NG_MethodParam.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # NG_MethodParamNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat NG_MethodParam.exe" # NG_MethodParamWithTypeFwd - SOURCE=NG_WidenAccess.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # NG_WidenAccessNoTypeFwd + SOURCE=NG_WidenAccess.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # NG_WidenAccessNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat NG_WidenAccess.exe" # NG_WidenAccessWithTypeFwd - SOURCE=NG_TurnToClass.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # NG_TurnToClassNoTypeFwd + SOURCE=NG_TurnToClass.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # NG_TurnToClassNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat NG_TurnToClass.exe NG_TurnToClass_x86_ExpErr.txt NG_TurnToClass_64_ExpErr.txt" # NG_TurnToClassWithTypeFwd ############################################################### ######## method of generic test - SOURCE=G_Method001.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_Method001NoTypeFwd + SOURCE=G_Method001.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_Method001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Method001.exe G_Method001_x86_ExpErr.txt G_Method001_64_ExpErr.txt" # G_Method001WithTypeFwd - SOURCE=G_Method002.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_Method002NoTypeFwd + SOURCE=G_Method002.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_Method002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Method002.exe G_Method002_x86_ExpErr.txt G_Method002_64_ExpErr.txt" # G_Method002WithTypeFwd ############################################################### #### constraint - SOURCE=G_Constraint001.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_constraint001NoTypeFwd + SOURCE=G_Constraint001.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_constraint001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_constraint001.exe" # G_constraint001WithTypeFwd - SOURCE=G_Constraint002.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_constraint002NoTypeFwd + SOURCE=G_Constraint002.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_constraint002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Method002.exe G_Constraint002_x86_ExpErr.txt G_Constraint002_64_ExpErr.txt" # G_constraint002WithTypeFwd - SOURCE=G_Constraint003.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_constraint003NoTypeFwd + SOURCE=G_Constraint003.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_constraint003NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_constraint003.exe" # G_constraint003WithTypeFwd - SOURCE=G_Constraint004.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_constraint004NoTypeFwd + SOURCE=G_Constraint004.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_constraint004NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Constraint004.exe G_Constraint004_x86_ExpErr.txt G_Constraint004_64_ExpErr.txt" # G_constraint004WithTypeFwd ############################################################### #### basic generic type forwarding test - SOURCE=G_Basic001.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic001NoTypeFwd + SOURCE=G_Basic001.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic001NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic001.exe" # G_basic001WithTypeFwd - SOURCE=G_Basic002.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic002NoTypeFwd + SOURCE=G_Basic002.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic002NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="CheckRuntimeException.bat G_Basic002.exe G_Basic002_x86_ExpErr.txt G_Basic002_64_ExpErr.txt" # G_basic002WithTypeFwd - SOURCE=G_Basic003.fs PRECMD="csc /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic003NoTypeFwd + SOURCE=G_Basic003.fs PRECMD="\$CSC_PIPE /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic003NoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic003.exe" # G_basic003WithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004A /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004aNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004A /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004aNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004aWithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004B /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004bNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004B /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004bNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004bWithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004C /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004cNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004C /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004cNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004cWithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004D /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004dNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004D /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004dNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004dWithTypeFwd - SOURCE=G_Basic004.fs PRECMD="csc /define:BASIC004E /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004eNoTypeFwd + SOURCE=G_Basic004.fs PRECMD="\$CSC_PIPE /define:BASIC004E /t:library Struct_Library.cs" SCFLAGS="--reference:Struct_Library.dll" # G_basic004eNoTypeFwd SOURCE=Dummy.fs PRECMD="BuildAssembly.bat" POSTCMD="checkForward.bat G_basic004.exe" # G_basic004eWithTypeFwd \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/TypeForwarding/test_Conformance_TypeForwarding.fs b/tests/fsharpqa/Source/Conformance/TypeForwarding/test_Conformance_TypeForwarding.fs new file mode 100644 index 00000000000..69c83f82291 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/TypeForwarding/test_Conformance_TypeForwarding.fs @@ -0,0 +1,302 @@ +module ``FSharpQA-Tests-Conformance-TypeForwarding`` + +open NUnit.Framework + +open NUnitConf +open PlatformHelpers +open RunPlTest + + + +module Class = + + [] + let Class () = check(attempt { + let ``BuildAssembly.bat`` workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} p >> checkResult + let csc = Commands.csc exec cfg.CSC_PIPE + + // @echo off + ignore "useless" + + // csc /t:library Class_Forwarder.cs + do! csc "/t:library" [ "Class_Forwarder.cs" ] + // csc /define:FORWARD /t:library /r:Class_Forwarder.dll Class_Library.cs + do! csc "/define:FORWARD /t:library /r:Class_Forwarder.dll" [ "Class_Library.cs" ] + + } + + let ``checkForward.bat`` exeToRun workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} (p |> Commands.getfullpath workDir) + + // @echo off + ignore "useless" + + // call %1 + return! match exec exeToRun "" with + // if errorlevel == 1 exit 1 + | CmdResult.ErrorLevel (m, 1) -> NUnitConf.genericError (sprintf "Exit code was %d: %s" 1 m) + // if errorlevel == 0 exit -1 + | CmdResult.Success -> NUnitConf.genericError (sprintf "Exit code was %d" 0) + // if errorlevel == -1 exit 0 + | CmdResult.ErrorLevel (_, -1) -> succeed () + // exit 1 + | CmdResult.ErrorLevel (m, x) -> NUnitConf.genericError (sprintf "Exit code was %d: '%s'" x m) + } + + let ``CheckRuntimeException.bat`` p1 p2 p3 workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} (p |> Commands.getfullpath workDir) + + return! + // is32bitruntime.exe + match exec "is32bitruntime.exe" "" with + // IF ERRORLEVEL 1 (recomp /p:%1 /ee:%3) + | CmdResult.ErrorLevel(m,i) -> attempt { + printfn "Exit code %i: %s" i m + do! exec "recomp" (sprintf "/p:%s /ee:%s" p1 p3) |> checkResult + } + // ELSE (recomp /p:%1 /ee:%2) + | CmdResult.Success -> attempt { + printfn "Exit code 0" + do! exec "recomp" (sprintf "/p:%s /ee:%s" p1 p2) |> checkResult + } + } + + + let cmds cmd = + match cmd with + | "BuildAssembly.bat" -> Some ``BuildAssembly.bat`` + | StartsWith "checkForward.bat " exeName -> Some (``checkForward.bat`` exeName) + | StartsWith "CheckRuntimeException.bat " args -> + let orEmpty = function None -> "" | Some s -> s + let args = args.Split([| ' ' |], System.StringSplitOptions.RemoveEmptyEntries) |> List.ofArray + let p1 = args |> List.tryItem 0 |> orEmpty + let p2 = args |> List.tryItem 1 |> orEmpty + let p3 = args |> List.tryItem 2 |> orEmpty + Some (``CheckRuntimeException.bat`` p1 p2 p3) + | _ -> None + + do! runplWithCmdsOverride cmds + + }) + + +module Cycle = + + [] + let Cycle () = check(attempt { + + let ``checkForward.bat`` exeToRun anotherExitCodeOk workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} (p |> Commands.getfullpath workDir) + + // @echo off + ignore "useless" + + // call %1 + return! match exec exeToRun "" with + // if errorlevel == 1 exit 1 + | CmdResult.ErrorLevel (m, 1) -> NUnitConf.genericError (sprintf "Exit code was %d: %s" 1 m) + // if errorlevel == 0 exit -1 + | CmdResult.Success -> NUnitConf.genericError (sprintf "Exit code was %d" 0) + // if errorlevel == -1 exit 0 + | CmdResult.ErrorLevel (_, -1) -> succeed () + // if errorlevel == %2 exit 0 + | CmdResult.ErrorLevel (_, n) when (Some (n.ToString())) = anotherExitCodeOk -> succeed () + // exit 1 + | CmdResult.ErrorLevel (m, x) -> NUnitConf.genericError (sprintf "Exit code was %d: '%s'" x m) + } + + + let cmds cmd = + match cmd with + | StartsWith "BuildAssembly.bat " code -> + Some (``Conformance-TypeForwarding-Cycle-BuildAssembly``.run code) + | StartsWith "checkForward.bat " exeAndArgs -> + let exe, arg1 = exeAndArgs |> splitAtFirst ((=) ' ') + Some (``checkForward.bat`` exe arg1) + | _ -> None + + do! runplWithCmdsOverride cmds + + }) + + +module Delegate = + + [] + let Delegate () = check(attempt { + let ``BuildAssembly.bat`` workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} p >> checkResult + let csc = Commands.csc exec cfg.CSC_PIPE + + // @echo off + ignore "useless" + + // csc /t:library Delegate_Forwarder.cs + do! csc "/t:library" [ "Delegate_Forwarder.cs" ] + // csc /define:FORWARD /t:library /r:Delegate_Forwarder.dll Delegate_Library.cs + do! csc "/define:FORWARD /t:library /r:Delegate_Forwarder.dll" [ "Delegate_Library.cs" ] + } + + let cmds cmd = + match cmd with + | "BuildAssembly.bat" -> Some ``BuildAssembly.bat`` + | _ -> None + + do! runplWithCmdsOverride cmds + + }) + + +module Interface = + + [] + let Interface () = check(attempt { + let ``BuildAssembly.bat`` workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} p >> checkResult + let csc = Commands.csc exec cfg.CSC_PIPE + + // @echo off + ignore "useless" + + // csc /t:library Interface_Forwarder.cs + do! csc "/t:library" [ "Interface_Forwarder.cs" ] + // csc /define:FORWARD /t:library /r:Interface_Forwarder.dll Interface_Library.cs + do! csc "/define:FORWARD /t:library /r:Interface_Forwarder.dll" [ "Interface_Library.cs" ] + } + + let cmds cmd = + match cmd with + | "BuildAssembly.bat" -> Some ``BuildAssembly.bat`` + | _ -> None + + do! runplWithCmdsOverride cmds + + }) + + +module Nested = + + [] + let Nested () = check(attempt { + let ``BuildCSharp.bat`` param workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} p >> checkResult + let csc = Commands.csc exec cfg.CSC_PIPE + + // @echo off + ignore "useless" + + // SET PARAM=%1 + ignore "from arguments" + + // csc /t:library %PARAM%_Forwarder.cs + do! csc "/t:library" [ sprintf "%s_Forwarder.cs" param ] + + // csc /define:FORWARD /t:library /r:%PARAM%_Forwarder.dll %PARAM%_Library.cs + do! csc (sprintf "/define:FORWARD /t:library /r:%s_Forwarder.dll" param) [ sprintf "%s_Library.cs" param ] + + } + + let ``checkForward.bat`` exeToRun workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} (p |> Commands.getfullpath workDir) + + // @echo off + ignore "useless" + + // call %1 + return! match exec exeToRun "" with + // if errorlevel == 1 exit 1 + | CmdResult.ErrorLevel (m, 1) -> NUnitConf.genericError (sprintf "Exit code was %d: %s" 1 m) + // if errorlevel == 0 exit -1 + | CmdResult.Success -> NUnitConf.genericError (sprintf "Exit code was %d" 0) + // if errorlevel == -1 exit 0 + | CmdResult.ErrorLevel (_, -1) -> succeed () + // exit 1 + | CmdResult.ErrorLevel (m, x) -> NUnitConf.genericError (sprintf "Exit code was %d: '%s'" x m) + } + + let cmds cmd = + match cmd with + | "BuildCSharp.bat Nested" -> Some (``BuildCSharp.bat`` "Nested") + | StartsWith "checkForward.bat " exeName -> + Some (``checkForward.bat`` exeName) + | _ -> None + + do! runplWithCmdsOverride cmds + + }) + + +module Struct = + + [] + let Struct () = check(attempt { + let ``BuildAssembly.bat`` workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} p >> checkResult + let csc = Commands.csc exec cfg.CSC_PIPE + + // @echo off + ignore "useless" + + // csc /t:library Struct_Forwarder.cs + do! csc "/t:library" [ "Struct_Forwarder.cs" ] + + // csc /define:FORWARD /t:library /r:Struct_Forwarder.dll Struct_Library.cs + do! csc "/define:FORWARD /t:library /r:Struct_Forwarder.dll" [ "Struct_Library.cs" ] + + } + + let ``checkForward.bat`` exeToRun workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} (p |> Commands.getfullpath workDir) + + // @echo off + ignore "useless" + + // call %1 + return! match exec exeToRun "" with + // if errorlevel == 1 exit 1 + | CmdResult.ErrorLevel (m, 1) -> NUnitConf.genericError (sprintf "Exit code was %d: %s" 1 m) + // if errorlevel == 0 exit -1 + | CmdResult.Success -> NUnitConf.genericError (sprintf "Exit code was %d" 0) + // if errorlevel == -1 exit 0 + | CmdResult.ErrorLevel (_, -1) -> succeed () + // exit 1 + | CmdResult.ErrorLevel (m, x) -> NUnitConf.genericError (sprintf "Exit code was %d: '%s'" x m) + } + + let ``CheckRuntimeException.bat`` p1 p2 p3 workDir (cfg: RunPl.RunPlConfig) = attempt { + let exec p = Command.exec workDir cfg.envVars { Output = Inherit; Input = None} (p |> Commands.getfullpath workDir) + + return! + // is32bitruntime.exe + match exec "is32bitruntime.exe" "" with + // IF ERRORLEVEL 1 (recomp /p:%1 /ee:%3) + | CmdResult.ErrorLevel(m,i) -> attempt { + printfn "Exit code %i: %s" i m + do! exec "recomp" (sprintf "/p:%s /ee:%s" p1 p3) |> checkResult + } + // ELSE (recomp /p:%1 /ee:%2) + | CmdResult.Success -> attempt { + printfn "Exit code 0" + do! exec "recomp" (sprintf "/p:%s /ee:%s" p1 p2) |> checkResult + } + } + + + let cmds cmd = + match cmd with + | "BuildAssembly.bat" -> Some ``BuildAssembly.bat`` + | StartsWith "checkForward.bat " exeName -> Some (``checkForward.bat`` exeName) + | StartsWith "CheckRuntimeException.bat " args -> + let orEmpty = function None -> "" | Some s -> s + let args = args.Split([| ' ' |], System.StringSplitOptions.RemoveEmptyEntries) |> List.ofArray + let p1 = args |> List.tryItem 0 |> orEmpty + let p2 = args |> List.tryItem 1 |> orEmpty + let p3 = args |> List.tryItem 2 |> orEmpty + Some (``CheckRuntimeException.bat`` p1 p2 p3) + | _ -> None + + do! runplWithCmdsOverride cmds + + }) + diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/LogicalPropertiesOfTypes/env.lst b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/LogicalPropertiesOfTypes/env.lst index 700b014da49..f4adc203fd5 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/LogicalPropertiesOfTypes/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/LogicalPropertiesOfTypes/env.lst @@ -25,7 +25,7 @@ NoMT SOURCE=BaseTypes_Tuple1.fs # BaseTypes_Tuple1.fs SOURCE=FSharpType_IsRecord.fs # FSharpType_IsRecord.fs - # Tests for the [] attribute +# Tests for the [] attribute SOURCE=AllowNullLiteral01.fs # AllowNullLiteral01.fs SOURCE=E_AllowNullLiteral01.fs # E_AllowNullLiteral01.fs SOURCE=E_AllowNullLiteral02.fs SCFLAGS="--test:ErrorRanges" # E_AllowNullLiteral02.fs diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/TypeParameterDefinitions/env.lst b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/TypeParameterDefinitions/env.lst index d33bde606e7..3f10da0008c 100644 --- a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/TypeParameterDefinitions/env.lst +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/TypeParameterDefinitions/env.lst @@ -2,7 +2,7 @@ SOURCE=HashConstraint01.fs # HashConstraint01.fs SOURCE=HashConstraint02.fs # HashConstraint02.fs SOURCE=E_GenericTypeConstraint.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_GenericTypeConstraint.fs - # Deprecating 'lazy' in type annotation +# Deprecating 'lazy' in type annotation SOURCE=E_LazyInType02.fs SCFLAGS="--test:ErrorRanges" # E_LazyInType02.fs SOURCE=MultipleConstraints01.fs # MultipleConstraints01.fs SOURCE=ValueTypesWithConstraints01.fs # ValueTypesWithConstraints01.fs diff --git a/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/test_Conformance_TypesAndTypeConstraints.fs b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/test_Conformance_TypesAndTypeConstraints.fs new file mode 100644 index 00000000000..a39e6d75a3e --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/TypesAndTypeConstraints/test_Conformance_TypesAndTypeConstraints.fs @@ -0,0 +1,28 @@ +module ``FSharpQA-Tests-Conformance-TypesAndTypeConstraints`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module CheckingSyntacticTypes = + + [] + let CheckingSyntacticTypes () = runpl |> check + + +module LogicalPropertiesOfTypes = + + [] + let LogicalPropertiesOfTypes () = runpl |> check + +module TypeConstraints = + + [] + let TypeConstraints () = runpl |> check + + +module TypeParameterDefinitions = + + [] + let TypeParameterDefinitions () = runpl |> check diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs index 0a42a52c550..028d13cfb5d 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:2732 -// +// // Note: you need the 'step' in the range in order to see the warning! [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs index 1f3fb5ae30d..60007529f20 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:2732 -//Floating point ranges are experimental -// +//Floating point ranges are experimental +// [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/env.lst index 07058de7ec7..391a37233e1 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/env.lst +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/env.lst @@ -1,13 +1,13 @@ -SOURCE=Positive01.fs SCFLAGS="--test:ErrorRanges -a" # Positive01.fs + SOURCE=Positive01.fs SCFLAGS="--test:ErrorRanges -a" # Positive01.fs -SOURCE=W_ImplicitProduct01.fs SCFLAGS="--test:ErrorRanges" # W_ImplicitProduct01.fs + SOURCE=W_ImplicitProduct01.fs SCFLAGS="--test:ErrorRanges" # W_ImplicitProduct01.fs -SOURCE=E_Error02.fs SCFLAGS="--test:ErrorRanges" # E_Error02.fs -SOURCE=E_Error03.fs SCFLAGS="--test:ErrorRanges" # E_Error03.fs -SOURCE=E_Error04.fs SCFLAGS="--test:ErrorRanges" # E_Error04.fs -SOURCE=E_Error05.fs SCFLAGS="--test:ErrorRanges" # E_Error05.fs -SOURCE=E_Error06.fs SCFLAGS="--test:ErrorRanges" # E_Error06.fs + SOURCE=E_Error02.fs SCFLAGS="--test:ErrorRanges" # E_Error02.fs + SOURCE=E_Error03.fs SCFLAGS="--test:ErrorRanges" # E_Error03.fs + SOURCE=E_Error04.fs SCFLAGS="--test:ErrorRanges" # E_Error04.fs + SOURCE=E_Error05.fs SCFLAGS="--test:ErrorRanges" # E_Error05.fs + SOURCE=E_Error06.fs SCFLAGS="--test:ErrorRanges" # E_Error06.fs -SOURCE=E_IncompleteParens01.fs SCFLAGS="--test:ErrorRanges" # E_IncompleteParens01.fs -SOURCE=E_IncompleteParens02.fs SCFLAGS="--test:ErrorRanges" # E_IncompleteParens02.fs + SOURCE=E_IncompleteParens01.fs SCFLAGS="--test:ErrorRanges" # E_IncompleteParens01.fs + SOURCE=E_IncompleteParens02.fs SCFLAGS="--test:ErrorRanges" # E_IncompleteParens02.fs diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs index 7395d9854f0..9ec6700386a 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs @@ -3,10 +3,10 @@ // ICE when using a known type (int, decimal, etc...) as a unit of measure //Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx index 72a6f9dc17a..5c28671b845 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx @@ -3,7 +3,7 @@ // In 1.9.6.2, this code snipped passed to fsi used to throw an ICE // This issue was automagically fixed in Beta1 // The text of the ICE was: FSC(0,0): error FS0192: internal error: find_gtdef: Continuous not found -// +// module Compounding = [] type Continuous diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs index 07cd9c4c656..bcb68704da5 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light module WithDecimal = diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs index e0d70933979..3a4b5c44f18 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light module WithFloat32 = diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs index 227548f506b..015e097a977 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs index 9eccc471df5..9ce56bde39b 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #ObjectOrientedTypes // Regression test for FSHARP1.0:3687 // ICE in Units of Measure + Polymorphism -// +// #light module Test diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/test_Conformance_UnitsOfMeasure.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/test_Conformance_UnitsOfMeasure.fs new file mode 100644 index 00000000000..5e5343029b4 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/test_Conformance_UnitsOfMeasure.fs @@ -0,0 +1,62 @@ +module ``FSharpQA-Tests-Conformance-UnitsOfMeasure`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + + +module Basic = + + [] + let Basic () = runpl |> check + + +module Bounds = + + [] + let Bounds () = runpl |> check + + +module Constants = + + [] + let Constants () = runpl |> check + + +module Diagnostics = + + [] + let Diagnostics () = runpl |> check + + +module Operators = + + [] + let Operators () = runpl |> check + + +module Parenthesis = + + [] + let Parenthesis () = runpl |> check + + +module Parsing = + + [] + let Parsing () = runpl |> check + + + +module TypeChecker = + + [] + let TypeChecker () = runpl |> check + + +module WithOOP = + + [] + let WithOOP () = runpl |> check diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs b/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs index 388da653fee..7f03cb7eee4 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2804 // Make sure we don't emit ?. (notice that the error message changed a bit since the bug was opened) -//\?\. +//\?\. // let f (x : int list) = int32 (x>>32) diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs b/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs index c863b0860a9..e3fb451018e 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:1181 -//syntax error +//syntax error // diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_IndexedPropertySetter01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_IndexedPropertySetter01.fs index 1e62e360bbe..d4925ba3a95 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_IndexedPropertySetter01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_IndexedPropertySetter01.fs @@ -2,7 +2,7 @@ // Used to be regression test for FSHARP1.0:1185 // to be compiled with --warnaserror+ //Invalid declaration syntax -// +//A type definition requires one or more members or other declarations\. If you intend to define an empty class, struct or interface, then use 'type \.\.\. = class end', 'interface end' or 'struct end' type T() = member this.X diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs b/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs index 9064787a01d..577d8c4f352 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs @@ -2,7 +2,7 @@ #light // Somehow related to the fix for FSHARP1.0:3143: as a result, now struct may be empty -// +// type StructType = struct end diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs index 4b9ce7abc5c..67024e490cc 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs @@ -3,7 +3,7 @@ // Regression test for FSHARP1.0:2670 //Unexpected symbol '<-' in pattern //The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. -//lambda +//lambda open Microsoft.FSharp.Control diff --git a/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs b/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs index 29d42721be9..16c61e22b67 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4579 // The following code should not give any error/warning -// +// module M let fromSeq (s: #seq<'schema>) = // <--- used to give a false warning that can't be eliminated s |> Array.ofSeq diff --git a/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs b/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs index 1ccac8da600..d65c5ad4470 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:3286 -// +// module M type C3<'a>() = class diff --git a/tests/fsharpqa/Source/Diagnostics/General/W_Keyword_tailcall01.fs b/tests/fsharpqa/Source/Diagnostics/General/W_Keyword_tailcall01.fs index 13f5d13b9e0..53c46c46893 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/W_Keyword_tailcall01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/W_Keyword_tailcall01.fs @@ -1,13 +1,13 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2204 -//\(13,11-13,19\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# -//\(14,12-14,20\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# -//\(15,14-15,22\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# -//\(15,27-15,35\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# -//\(17,13-17,21\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# -//\(17,24-17,32\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# -//\(17,33-17,41\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# -//\(18,22-18,30\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# +//\(13,11-13,19\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# +//\(14,12-14,20\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# +//\(15,14-15,22\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# +//\(15,27-15,35\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# +//\(17,13-17,21\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# +//\(17,24-17,32\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# +//\(17,33-17,41\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# +//\(18,22-18,30\).+warning FS0046: The keyword 'tailcall' is reserved for future use by F# #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs index 3e7a4a52c87..900a961bd2c 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:3702 -//NONTERM +//NONTERM //Incomplete structured construct at or before this point in union case\. Expected identifier, '\(', '\(\*\)' or other token\.$ diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs index c1853be0bbd..230f550003a 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs @@ -1,8 +1,8 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2369 -//NONTERM -//Unexpected symbol '<' in expression\. Expected '}' or other token\. -//: error : Unmatched '{'$ +//NONTERM +//Unexpected symbol '<' in expression\. Expected '}' or other token\. +//Unmatched '{'$ #light {< diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs index 43e9b79ad30..849880f6ca3 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM // #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs index 27268bf5fcc..a9fb1c5dd80 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2219 -//NONTERM +//NONTERM //Unexpected keyword 'val' in definition [] diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs index 349e0f1f235..44cf67e9c04 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2681 -//NONTERM +//NONTERM //Unexpected start of structured construct in definition\. Expected identifier, 'global' or other token\. module '\U00002620' diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs index af5eb1ce3bf..60c5736d092 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2681 // To repro: fsi.exe < foo.fs, otherwise it won't repro! // This test used to emit an error, now (after fix for 2193, it works fine) -//\^\^\^\^\^ -// +//\^\^\^\^\^ +// '\U00002620';; exit 0;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs index 246b03087a8..7005248760c 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2324 -//NONTERM +//NONTERM //Unexpected symbol '\[<' in definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs index cd027304f9e..c68c6b60c4f 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol ';;' in expression\. Expected '\]' or other token\.$ //Unmatched '\['$ [1;;2] diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs index 20571c7106c..a68c24f01b8 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol ',' in lambda expression. fun x, y -> x < y diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs index 29c2971575f..d51d30c1366 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected keyword 'member' in type definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs index b35c66c64cc..d350cec694d 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected keyword 'member' in type definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs index 690122a45a9..e7aa4511525 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol '.' in implementation file failwith "foo" : int;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs index b8ec396377b..4046e284f40 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4245 -//NONTERM +//NONTERM //Unexpected character '.' in implementation file \;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs index fac2ce699d1..39cfda78348 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4245 -//NONTERM +//NONTERM //Unexpected keyword 'member' in implementation file member private this.Size with set newSize = m_size <- newSize;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs index fd0312d50e7..2e135a6fba1 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2104 -//NONTERM +//NONTERM //Unexpected end of input$ #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs index 7f4300249e9..765257c1562 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2106 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs index e40a3437265..4d0087137cd 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2391, FSHARP1.0:1479 -//NONTERM +//NONTERM // #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs index 231d1ec0cca..6e950dfac58 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it -//NONTERM +//NONTERM //Unexpected keyword 'lazy' in type definition$ // 5 elements -> ok diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs index 23154a25c9d..400bc6d4ab7 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2467 -//NONTERM +//NONTERM //Unexpected symbol '->' in type #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs index 4a15b697fae..9f5c695916f 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2648 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs index c7b2f1c622f..cc7101d992b 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2237 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs index e9c309d66b7..704409444c3 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2237 -//NONTERM +//NONTERM // diff --git a/tests/fsharpqa/Source/Diagnostics/test_Diagnostics.fs b/tests/fsharpqa/Source/Diagnostics/test_Diagnostics.fs new file mode 100644 index 00000000000..3b937978671 --- /dev/null +++ b/tests/fsharpqa/Source/Diagnostics/test_Diagnostics.fs @@ -0,0 +1,31 @@ +module ``FSharpQA-Tests-Diagnostics`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + +module async = + + [] + let async () = runpl |> check + + +module General = + + [] + let General () = runpl |> check + + +module NONTERM = + + [] + let NONTERM () = runpl |> check + + +module ParsingAtEOF = + + [] + let ParsingAtEOF () = runpl |> check + diff --git a/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs b/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs index 47a8c8bbcfa..1d072229680 100644 --- a/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs +++ b/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // Attribute is last declaration on first file //Hello -//A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. +//A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. module TestModule [] diff --git a/tests/fsharpqa/Source/EntryPoint/behavior001.fs b/tests/fsharpqa/Source/EntryPoint/behavior001.fs index d8186ff9214..1bbaa34c252 100644 --- a/tests/fsharpqa/Source/EntryPoint/behavior001.fs +++ b/tests/fsharpqa/Source/EntryPoint/behavior001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1304 // Explicit program entry point: [] // Verify that static initializers are invoked before entering the 'main' function -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs index 04b0092e960..a8f28497cd8 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs +++ b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #EntryPoint // Regression test for FSHARP1.0:2209 - existence of this attribute should not confuse FSI // Explicit program entry point: [] -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx index b3465af492b..535ab9aa2f4 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx +++ b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx @@ -1,7 +1,7 @@ // #Regression #NoMT #EntryPoint // Regression test for FSHARP1.0:2209 - existence of this attribute should not confuse FSI // Explicit program entry point: [] -// +// module M = [] diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs b/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs index 048debefa95..5d5659a9022 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs +++ b/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1793 // Explicit program entry point: [] // Entry point function does not have to be called 'main' -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/inamodule001.fs b/tests/fsharpqa/Source/EntryPoint/inamodule001.fs index c6e22cef201..71070cb0266 100644 --- a/tests/fsharpqa/Source/EntryPoint/inamodule001.fs +++ b/tests/fsharpqa/Source/EntryPoint/inamodule001.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function is in a module //Hello -// +// #light module M = diff --git a/tests/fsharpqa/Source/EntryPoint/noarguments001.fs b/tests/fsharpqa/Source/EntryPoint/noarguments001.fs index 688afe23d52..08b4ef60cf4 100644 --- a/tests/fsharpqa/Source/EntryPoint/noarguments001.fs +++ b/tests/fsharpqa/Source/EntryPoint/noarguments001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1304 // Explicit program entry point: [] // 'main' function invoked with no arguments -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/oneargument001.fs b/tests/fsharpqa/Source/EntryPoint/oneargument001.fs index 47c4ee5a4e7..c50c8334ac8 100644 --- a/tests/fsharpqa/Source/EntryPoint/oneargument001.fs +++ b/tests/fsharpqa/Source/EntryPoint/oneargument001.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with 1 argument //Hello -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs b/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs index 98ea1ad7ddd..89db75bb9e2 100644 --- a/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs +++ b/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with no arguments //Hello -// +// module M diff --git a/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs b/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs index eb54d7243e6..41a6d23c11d 100644 --- a/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs +++ b/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with no arguments //Hello -// +// module TestModule diff --git a/tests/fsharpqa/Source/EnvLst.fs b/tests/fsharpqa/Source/EnvLst.fs index 8bb9931b357..61d92900515 100644 --- a/tests/fsharpqa/Source/EnvLst.fs +++ b/tests/fsharpqa/Source/EnvLst.fs @@ -43,13 +43,15 @@ let private parseDataParts (from: string) = | pre, "", _ -> pre, "" | pre, "\"", xs when pre.EndsWith("\\") -> //escaped " - innerQuote (pre + "\"") xs + let preEscapeRemoved = pre.Substring(0, pre.Length-1) + innerQuote (preEscapeRemoved + "\"") 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) + let valueSlashUnescaped = value.Replace("\\\\", "\\") + parseDataPartsHelper rest (DataPart.Var(name, valueSlashUnescaped) :: xs) | a -> //unquoted, like SOURCE=avalue let value, rest = match a |> splitAtFirst Char.IsWhiteSpace with diff --git a/tests/fsharpqa/Source/ErrorMessages/test_ErrorMessages.fs b/tests/fsharpqa/Source/ErrorMessages/test_ErrorMessages.fs new file mode 100644 index 00000000000..57327bd1363 --- /dev/null +++ b/tests/fsharpqa/Source/ErrorMessages/test_ErrorMessages.fs @@ -0,0 +1,12 @@ +module ``FSharpQA-Tests-ErrorMessages`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module NameResolution = + + [] + let NameResolution () = runpl |> check + diff --git a/tests/fsharpqa/Source/FSharpQA.Tests.fsproj b/tests/fsharpqa/Source/FSharpQA.Tests.fsproj index 49451a93459..6f003455d0c 100644 --- a/tests/fsharpqa/Source/FSharpQA.Tests.fsproj +++ b/tests/fsharpqa/Source/FSharpQA.Tests.fsproj @@ -78,11 +78,44 @@ + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/fsharpqa/Source/Import/assign_to_static_field01.fs b/tests/fsharpqa/Source/Import/assign_to_static_field01.fs index 34cc7e1daec..345f0bf6605 100644 --- a/tests/fsharpqa/Source/Import/assign_to_static_field01.fs +++ b/tests/fsharpqa/Source/Import/assign_to_static_field01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #Import // Regression test for FSHARP1.0:2097 // Make sure we can assign to a static field imported from a C# assembly -// +// #light // Retrieve initial value diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx index 2e75878deb0..faf248d922e 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx @@ -2,13 +2,13 @@ // Regression test for FSHARP1.0:2549 // See also CL:14579 -//type T = -//class -//member M1 : x:int \* y:string -> \('a -> unit\) -//member M2 : \(int \* string\) -> \('a -> unit\) -//exception ExnType of int \* string -//type DiscUnion = \| DataTag of int \* string -//val f : x:int -> y:int -> int +//type T = +//class +//member M1 : x:int \* y:string -> \('a -> unit\) +//member M2 : \(int \* string\) -> \('a -> unit\) +//exception ExnType of int \* string +//type DiscUnion = \| DataTag of int \* string +//val f : x:int -> y:int -> int type T = diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx index 2b6910f9d4d..470c777459e 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx @@ -1,8 +1,8 @@ // #Regression #NoMT #FSI // Regression test for FSharp1.0:4164 - FSI emit "please report to fsbugs" error on malformed usage of .. operator -// fsbug -// nonTerminalId\.GetTag +// fsbug +// nonTerminalId\.GetTag //Unexpected symbol '\.\.' in interaction\. Expected incomplete structured construct at or before this point, ';', ';;' or other token\.$ aaaa..;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs b/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs index 262e185ff9b..f586a8e714a 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI // Regression test for FSHARP1.0:4118 // FSI: PrettyPrinting of nativeint or unativeint does not emit the suffix (n or un, respectively) -// val it : nativeint = 2n +// val it : nativeint = 2n nativeint 2;; #q;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx index 8c881ca1c68..c460dc7bfdf 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx @@ -1,4 +1,4 @@ // #NoMT #FSI #NoMono #NETFX20Only -//v3\.5.+System\.Core\.dll +//v3\.5.+System\.Core\.dll #r "System.Core.dll";; exit 0;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx index 2c2cdec06c4..08bf37857a7 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx @@ -1,4 +1,4 @@ // #NoMT #FSI #NoMono #NETFX40Only -//v4\.0.+System\.Core\.dll +//v4\.0.+System\.Core\.dll #r "System.Core.dll";; exit 0;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx index fa3a42fb800..68f6270275d 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI #RequiresENU // Regression test for FSharp1.0:4164 - FSI emit "please report to fsbugs" error on malformed usage of .. operator -// Timing now on -// Timing now off +// Timing now on +// Timing now off #time "on" #time "off" diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs b/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs index 57fd75df7b8..482a39bc849 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI // Regression test for FSHARP1.0:4118 // FSI: PrettyPrinting of nativeint or unativeint does not emit the suffix (n or un, respectively) -// val it : unativeint = 2un +// val it : unativeint = 2un unativeint 2;; #q;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx index 94417a53524..9947eb92f90 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx @@ -1,6 +1,6 @@ // #NoMT #FSI -//val it : int = 42 -//val it : unit = \(\) +//val it : int = 42 +//val it : unit = \(\) 42;; ();; #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/env.lst b/tests/fsharpqa/Source/InteractiveSession/Misc/env.lst index 03dcd5eb60c..e5bbd10d00b 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/env.lst +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/env.lst @@ -29,7 +29,7 @@ ReqENU SOURCE=E_InterfaceCrossConstrained02.fsx COMPILE_ONLY=1 FSIMODE=PIPE SC SOURCE=ToStringNull.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo" # ToStringNull.fsx - SOURCE=EnumerateSets.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo" # EnumerateSets.fsx + SOURCE=EnumerateSets.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo" # EnumerateSets.fsx # These are the regression tests for FSHARP1.0:5427 # The scenario is a bit convoluted because of the way we end up doing the verification @@ -64,7 +64,7 @@ NOMONO SOURCE=References40.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo" # SOURCE=DontShowCompilerGenNames01.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo" # DontShowCompilerGenNames01.fsx SOURCE=ReflectionTypeNameMangling01.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo" # ReflectionTypeNameMangling01.fsx - SOURCE=CommandLineArgs01.fs COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS= # CommandLineArgs01.fs + SOURCE=CommandLineArgs01.fs COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="" # CommandLineArgs01.fs SOURCE=CommandLineArgs01b.fs COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS=-- # CommandLineArgs01b.fs SOURCE=CommandLineArgs02.fs COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="-- Hello" # CommandLineArgs02.fs diff --git a/tests/fsharpqa/Source/InteractiveSession/test_InteractiveSession.fs b/tests/fsharpqa/Source/InteractiveSession/test_InteractiveSession.fs new file mode 100644 index 00000000000..b06d2287665 --- /dev/null +++ b/tests/fsharpqa/Source/InteractiveSession/test_InteractiveSession.fs @@ -0,0 +1,11 @@ +module ``FSharpQA-Tests-InteractiveSession`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module Misc = + + [] + let Misc () = runpl |> check diff --git a/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx b/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx index d753159960c..ba675c60d73 100644 --- a/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx +++ b/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx @@ -1,60 +1,60 @@ // #Regression #Libraries #LanguagePrimitives #ReqNOMT // Regression test for FSHARP1.0:5894 -//val it : string = "1" -//val it : string = "1.00001" -//val it : string = "-1.00001" -//val it : string = "1" -//val it : string = "1.00001" -//val it : string = "-1.00001" -//val it : string = "127" -//val it : string = "-128" -//val it : string = "0" -//val it : string = "-1" -//val it : string = "1" -//val it : string = "255" -//val it : string = "0" -//val it : string = "0" -//val it : string = "1" -//val it : string = "32767" -//val it : string = "-32768" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "65535" -//val it : string = "0" -//val it : string = "0" -//val it : string = "110" -//val it : string = "2147483647" -//val it : string = "-2147483648" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "4294967295" -//val it : string = "0" -//val it : string = "0" -//val it : string = "10" -//val it : string = "9223372036854775807" -//val it : string = "-9223372036854775808" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "18446744073709551615" -//val it : string = "0" -//val it : string = "0" -//val it : string = "10" -//val it : string = "79228162514264337593543950335" -//val it : string = "-79228162514264337593543950335" -//val it : string = "0" -//val it : string = "12345678" -//val it : string = "-12345678" -//val it : string = "-Infinity" -//val it : string = "Infinity" -//val it : string = "NaN" -//val it : string = "-Infinity" -//val it : string = "Infinity" -//val it : string = "NaN" -//val it : string = "210f4d6b-cb42-4b09-baa1-f1aa8e59d4b0" +//val it : string = "1" +//val it : string = "1.00001" +//val it : string = "-1.00001" +//val it : string = "1" +//val it : string = "1.00001" +//val it : string = "-1.00001" +//val it : string = "127" +//val it : string = "-128" +//val it : string = "0" +//val it : string = "-1" +//val it : string = "1" +//val it : string = "255" +//val it : string = "0" +//val it : string = "0" +//val it : string = "1" +//val it : string = "32767" +//val it : string = "-32768" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "65535" +//val it : string = "0" +//val it : string = "0" +//val it : string = "110" +//val it : string = "2147483647" +//val it : string = "-2147483648" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "4294967295" +//val it : string = "0" +//val it : string = "0" +//val it : string = "10" +//val it : string = "9223372036854775807" +//val it : string = "-9223372036854775808" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "18446744073709551615" +//val it : string = "0" +//val it : string = "0" +//val it : string = "10" +//val it : string = "79228162514264337593543950335" +//val it : string = "-79228162514264337593543950335" +//val it : string = "0" +//val it : string = "12345678" +//val it : string = "-12345678" +//val it : string = "-Infinity" +//val it : string = "Infinity" +//val it : string = "NaN" +//val it : string = "-Infinity" +//val it : string = "Infinity" +//val it : string = "NaN" +//val it : string = "210f4d6b-cb42-4b09-baa1-f1aa8e59d4b0" (string 1.0f);; (string 1.00001f);; diff --git a/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs b/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs index be46abb5e19..6baa69c85f2 100644 --- a/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs +++ b/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs @@ -1,7 +1,7 @@ // #Regression #Libraries #Operators // Regression test for FSHARP1.0:1247 // Precedence of type annotations :> and :?> over preceeding expression forms, e.g. if-then-else etc. -// +// open System let x = 2 :> Object diff --git a/tests/fsharpqa/Source/Libraries/Core/test_libraries_core.fs b/tests/fsharpqa/Source/Libraries/Core/test_libraries_core.fs new file mode 100644 index 00000000000..63f99781bf9 --- /dev/null +++ b/tests/fsharpqa/Source/Libraries/Core/test_libraries_core.fs @@ -0,0 +1,47 @@ +module ``FSharpQA-Tests-Libraries-Core`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module Collections = + + [] + let Collections () = runpl |> check + +module ExtraTopLevelOperators = + + [] + let ExtraTopLevelOperators () = runpl |> check + +module LanguagePrimitives = + + [] + let LanguagePrimitives () = runpl |> check + +module NativeInterop_stackalloc = + + [] + let stackalloc () = runpl |> check + +module Operators = + + [] + let Operators () = runpl |> check + +module PartialTrust = + + [] + let PartialTrust () = runpl |> check + +module Reflection = + + [] + let Reflection () = runpl |> check + +module Unchecked = + + [] + let Unchecked () = runpl |> check + diff --git a/tests/fsharpqa/Source/Libraries/test_libraries.fs b/tests/fsharpqa/Source/Libraries/test_libraries.fs new file mode 100644 index 00000000000..75269b89b70 --- /dev/null +++ b/tests/fsharpqa/Source/Libraries/test_libraries.fs @@ -0,0 +1,17 @@ +module ``FSharpQA-Tests-Libraries`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + +module Control = + + [] + let Control () = runpl |> check + +module Portable = + + [] + let Portable () = runpl |> check + diff --git a/tests/fsharpqa/Source/Misc/DefaultManifest.fs b/tests/fsharpqa/Source/Misc/DefaultManifest.fs index c0ba0869d9c..d8a24920ed2 100644 --- a/tests/fsharpqa/Source/Misc/DefaultManifest.fs +++ b/tests/fsharpqa/Source/Misc/DefaultManifest.fs @@ -1,5 +1,5 @@ // The compiler should add an embedded default win32 manifest so that UAC is handled properly -// +// open System open System.Text diff --git a/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs b/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs index b86d9317002..c0c2384da29 100644 --- a/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs +++ b/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs @@ -1,7 +1,7 @@ // #Regression #Misc #NoMono // Regression test for FSHARP1.0:1668 // Compiler should provide a way to embed manifest files -// +// open System.Reflection let thisExe = System.Reflection.Assembly.GetExecutingAssembly() diff --git a/tests/fsharpqa/Source/Misc/env.lst b/tests/fsharpqa/Source/Misc/env.lst index 7f35d3e1711..4cc8f047042 100644 --- a/tests/fsharpqa/Source/Misc/env.lst +++ b/tests/fsharpqa/Source/Misc/env.lst @@ -25,7 +25,7 @@ NOMONO SOURCE=WhetherEmbededManifest.fs # WhetherEmbededManifest.fs SOURCE="FileWithSameNameDiffExt.fs FileWithSameNameDiffExt.fsx" # FileWithSameNameDiffExt SOURCE=E_CompiledName.fs SCFLAGS="-a --test:ErrorRanges --flaterrors" # E_CompiledName.fs SOURCE=LongSourceFile01.fs COMPILE_ONLY=1 # LongSourceFile01.fs - SOURCE=AsyncOperations.fs 6448.fs # 6448.fs + SOURCE="AsyncOperations.fs 6448.fs" # 6448.fs NoMT SOURCE=SerializableClosure01.fs # SerializableClosure01.fs NoMT SOURCE=AssemblyResolve01.fs # AssemblyResolve01.fs diff --git a/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs b/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs index 47ede512117..471653dabd8 100644 --- a/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs +++ b/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs @@ -4,7 +4,7 @@ // FSHARP1.0:1117, Bindings that look like function definitions are interpreted as pattern matches without warning. Add a warning for this case to allow for later language design change here. // FSHARP1.0:2552, name scoping bug -// +// type t = F of int * int diff --git a/tests/fsharpqa/Source/Optimizations/CompareIL.cmd b/tests/fsharpqa/Source/Optimizations/CompareIL.cmd index fd3c94429fa..bf069a39b59 100644 --- a/tests/fsharpqa/Source/Optimizations/CompareIL.cmd +++ b/tests/fsharpqa/Source/Optimizations/CompareIL.cmd @@ -1,7 +1,7 @@ REM == %1 --> assembly REM == %2 --> NetFx20|NetFx40 (default is NetFx20) - case insensitive -ildasm /TEXT /LINENUM /NOBAR "%~nx1" >"%~n1.il" +%ildasm% /TEXT /LINENUM /NOBAR "%~nx1" >"%~n1.il" IF NOT ERRORLEVEL 0 exit 1 IF /I "%2"=="NetFx40" goto :NetFx4 diff --git a/tests/fsharpqa/Source/Optimizations/test_Optimizations.fs b/tests/fsharpqa/Source/Optimizations/test_Optimizations.fs new file mode 100644 index 00000000000..196af314295 --- /dev/null +++ b/tests/fsharpqa/Source/Optimizations/test_Optimizations.fs @@ -0,0 +1,33 @@ +module ``FSharpQA-Tests-Optimizations`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + + +module AssemblyBoundary = + + [] + let AssemblyBoundary () = runpl |> check + + + +module ForLoop = + + [] + let ForLoop () = runpl |> check + + +module GenericComparison = + + [] + let GenericComparison () = runpl |> check + + +module Inlining = + + [] + let Inlining () = runpl |> check + diff --git a/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx b/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx index 70759d638d1..3e66e4899e5 100644 --- a/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx +++ b/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx @@ -3,27 +3,27 @@ // Test for FSharp1.0:2581 - FSI should display bound values, not just evaluated expressions (was: FSI should print the value of the last declared value is there is no last expression) -//type RecT = -// {Name: string;} -//type Bldg = -// \| House -// \| Museum -// \| Office -//val a : int = 1 -//val B : string = "Hello" -//val c' : RecT = {Name = "F#";} -//val _d : Bldg = Office -//val e : seq -//val F'F : int list = \[3; 2; 1] -//val g : Set -//val g' : Set<'a> -//val getPointF : x:float32 \* y:float32 -> System\.Drawing\.PointF -//val h : System\.Drawing\.PointF = {X=.+, Y=.+} -//val i : int \* RecT \* Bldg = \(1, {Name = "F#";}, Office\) -//val J_ : int \[\] = \[\|1; 2; 3\|] -//val j_' : float \[\] = \[\|1\.0; 1\.0\|] -//val j_'_ : RecT \[\] = \[\|\|] -//val j_'' : string \[\] = \[\|"0"; "1"; "2"; "3"; "4"\|] +//type RecT = +// {Name: string;} +//type Bldg = +// \| House +// \| Museum +// \| Office +//val a : int = 1 +//val B : string = "Hello" +//val c' : RecT = {Name = "F#";} +//val _d : Bldg = Office +//val e : seq +//val F'F : int list = \[3; 2; 1] +//val g : Set +//val g' : Set<'a> +//val getPointF : x:float32 \* y:float32 -> System\.Drawing\.PointF +//val h : System\.Drawing\.PointF = {X=.+, Y=.+} +//val i : int \* RecT \* Bldg = \(1, {Name = "F#";}, Office\) +//val J_ : int \[\] = \[\|1; 2; 3\|] +//val j_' : float \[\] = \[\|1\.0; 1\.0\|] +//val j_'_ : RecT \[\] = \[\|\|] +//val j_'' : string \[\] = \[\|"0"; "1"; "2"; "3"; "4"\|] type RecT = { Name : string } diff --git a/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx b/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx index d1332158c18..a2e328e9c9f 100644 --- a/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx +++ b/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx @@ -2,9 +2,9 @@ #light // Test for FSharp1.0:4086 - accessiblity not printed for exceptions -// exception internal A of int -// exception private B of string -// exception C of System\.DateTime +// exception internal A of int +// exception private B of string +// exception C of System\.DateTime exception internal A of int exception private B of string diff --git a/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs b/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs index e20b0c73582..dfba9954c26 100644 --- a/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs +++ b/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:4725 // F# is not disposing an IEnumerator in implementation of sprintf "%A" -//Done +//Done let x = seq { try yield 1; yield 2; finally printfn "Done" } diff --git a/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx b/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx index 712a9f5ed34..c68d6bbb8e2 100644 --- a/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx +++ b/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx @@ -2,10 +2,10 @@ // Regression test for https://github.com/Microsoft/visualfsharp/issues/109 // pretty printing signatures with params arguments -//type Heterogeneous = -// class -// static member Echo : \[\] args:obj \[\] -> obj \[\] -// end +//type Heterogeneous = +// class +// static member Echo : \[\] args:obj \[\] -> obj \[\] +// end type Heterogeneous = static member Echo([] args: obj[]) = args diff --git a/tests/fsharpqa/Source/Printing/Quotation01.fs b/tests/fsharpqa/Source/Printing/Quotation01.fs index bf6ce9e2479..c34e1e78fbb 100644 --- a/tests/fsharpqa/Source/Printing/Quotation01.fs +++ b/tests/fsharpqa/Source/Printing/Quotation01.fs @@ -1,7 +1,7 @@ // #NoMT #Printing // Regression test for FSHARP1.0:524 -//val it : Quotations.Expr = Value \(1\) {CustomAttributes = \[||\]; -// Raw = \.\.\.; -// Type = System\.Int32;} +//val it : Quotations.Expr = Value \(1\) {CustomAttributes = \[||\]; +// Raw = \.\.\.; +// Type = System\.Int32;} <@ 1 @>;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs b/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs index 7473f0a5214..5605d46d4d0 100644 --- a/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs +++ b/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs @@ -2,14 +2,14 @@ // Regression test for FSHARP1.0:1110 // pretty printing signatures with optional arguments -//type AsyncTimer = -// class -// new : f:\(unit -> unit\) \* \?delay:int -> AsyncTimer -// member Start : unit -> unit -// member Stop : unit -> unit -// member Delay : int option -// member Delay : int option with set -// end +//type AsyncTimer = +// class +// new : f:\(unit -> unit\) \* \?delay:int -> AsyncTimer +// member Start : unit -> unit +// member Stop : unit -> unit +// member Delay : int option +// member Delay : int option with set +// end open Microsoft.FSharp.Control diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx index ca110a61825..d4643be3c79 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx @@ -1,9 +1,9 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:3300 // Verify that Pretty-printing of measure identifiers round-trips, i.e. displays the long identified (Namespace.Module.Type) -//val it : decimal = -2\.0M -//val it : float32 = 2\.0f -//val it : float = 1\.2 +//val it : decimal = -2\.0M +//val it : float32 = 2\.0f +//val it : float = 1\.2 #light module M1 = diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx index db0557eb71e..bbe92033fa4 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx @@ -1,9 +1,9 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:3300 // Verify that Pretty-printing of measure identifiers round-trips, i.e. displays the long identified (Namespace.Module.Type) -//val it : decimal = -2\.0M -//val it : float32 = 2\.0f -//val it : float = 1\.2 +//val it : decimal = -2\.0M +//val it : float32 = 2\.0f +//val it : float = 1\.2 #light #r "UnitsOfMeasureIdentifiersRoundTrip02.dll" diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx index 1366f40b821..614f47487ff 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx @@ -3,6 +3,6 @@ // Make sure the generic type variable is echoed back // (notice that the next time we evaluate 'f' this // goes back to 'u) -//val f : x:float<'a> -> float<'a \^ 2> +//val f : x:float<'a> -> float<'a \^ 2> let f(x:float<'a>) = x*x;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx index d57eda1d03e..4214a32c64a 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx @@ -4,6 +4,6 @@ // (notice that the next time we evaluate 'f' this // goes back to 'u, 'v) // This is the case where the generic function takes 2 args -//val g : x:float<'a> -> y:float32<'b> -> float<'a> +//val g : x:float<'a> -> y:float32<'b> -> float<'a> let g (x:float<'a>) (y:float32<'b>) = x * float y;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/VariantTypes01.fs b/tests/fsharpqa/Source/Printing/VariantTypes01.fs index 10ab2c05366..074e72da981 100644 --- a/tests/fsharpqa/Source/Printing/VariantTypes01.fs +++ b/tests/fsharpqa/Source/Printing/VariantTypes01.fs @@ -2,6 +2,6 @@ // Regression test for FSHARP1.0:1401 // incorrect pretty printing of variant types // The issue here was the missing parens around the nested Some ... -//val it : int option option = Some \(Some 1\) +//val it : int option option = Some \(Some 1\) Some(Some(1));; exit 0;; diff --git a/tests/fsharpqa/Source/Stress/CodeGeneratorFor2766.fsx b/tests/fsharpqa/Source/Stress/CodeGeneratorFor2766.fsx index 56d84be835c..1718a46145b 100644 --- a/tests/fsharpqa/Source/Stress/CodeGeneratorFor2766.fsx +++ b/tests/fsharpqa/Source/Stress/CodeGeneratorFor2766.fsx @@ -8,7 +8,7 @@ let writer = new StreamWriter("2766.fs") writer.WriteLine("//Negative Stress test for FSharp1.0#2766 - Internal error on parser when given unbalanced and deeply nested parens") //Unexpected end of input in expression -writer.WriteLine("//parse error: unexpected end of file") +writer.WriteLine("//parse error: unexpected end of file") writer.WriteLine("let x = (1 + ") diff --git a/tests/fsharpqa/Source/Warnings/ReturnInsteadOfReturnBang.fs b/tests/fsharpqa/Source/Warnings/ReturnInsteadOfReturnBang.fs index d9f87c521bd..a015c85a0b6 100644 --- a/tests/fsharpqa/Source/Warnings/ReturnInsteadOfReturnBang.fs +++ b/tests/fsharpqa/Source/Warnings/ReturnInsteadOfReturnBang.fs @@ -1,9 +1,9 @@ // #Warnings //Type mismatch. Expecting a -//''a' -//but given a -//'Async<'a>' -//The types ''a' and 'Async<'a>' cannot be unified. Consider using 'return!' instead of 'return'. +//''a' +//but given a +//'Async<'a>' +//The types ''a' and 'Async<'a>' cannot be unified. Consider using 'return!' instead of 'return'. let rec foo() = async { return foo() } diff --git a/tests/fsharpqa/Source/Warnings/YieldInsteadOfYieldBang.fs b/tests/fsharpqa/Source/Warnings/YieldInsteadOfYieldBang.fs index bd547fa7b28..8833f8be5d5 100644 --- a/tests/fsharpqa/Source/Warnings/YieldInsteadOfYieldBang.fs +++ b/tests/fsharpqa/Source/Warnings/YieldInsteadOfYieldBang.fs @@ -1,9 +1,9 @@ // #Warnings -//Type mismatch. Expecting a -//''a' -//but given a -//''a list' -//The types ''a' and ''a list' cannot be unified. Consider using 'yield!' instead of 'yield'. +//Type mismatch. Expecting a +//''a' +//but given a +//''a list' +//The types ''a' and ''a list' cannot be unified. Consider using 'yield!' instead of 'yield'. type Foo() = member this.Yield(x) = [x] diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs b/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs index 8761062c0fa..793c9a1d636 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs @@ -1,6 +1,6 @@ // #XMLDoc // Regression test for Dev11:40070 -// +// /// Doc comment for Test. type Test = diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs index 7f1b8ea3bea..8f1d1234e94 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs @@ -1,7 +1,7 @@ // #XMLDoc // Regression test for FSHARP1.0:850 // Simple /// is xmldoc -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs index 8a1adafce7f..a2120d38eb9 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs @@ -1,7 +1,7 @@ // #XMLDoc // Regression test for FSHARP1.0:850 // Verify that //// is not xmldoc -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs index fd817a80100..a2930dea500 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs @@ -2,7 +2,7 @@ // This used to be regression test for FSHARP1.0:850 // Now, we simple verify that OCaml style xml-doc are gone (i.e. treated as regular comments) // Verify that //// is not xmldoc (after an ocaml-style xml-comment) -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs index 1b90a21e47e..15767fff559 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs @@ -1,6 +1,6 @@ // #Regression #XMLDoc // Verify that XmlDoc name is correctly generated -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs index 4fa8dbecaca..76977a7eec0 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs @@ -1,6 +1,6 @@ // #Regression #XMLDoc // Verify that XmlDoc names are generated, but no empty members are generated re: issue #148 -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs b/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs index 723484f1ba4..f3338bfb757 100644 --- a/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs +++ b/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs @@ -3,7 +3,7 @@ // Now that the OCaml style XmlDoc is gone, (** ... *) should be just a normal comment. // We want to verify that no xml with a "summary" is generate. // See also FSHARP1.0:1654 -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/test_XmlDoc.fs b/tests/fsharpqa/Source/XmlDoc/test_XmlDoc.fs new file mode 100644 index 00000000000..5eece8b041a --- /dev/null +++ b/tests/fsharpqa/Source/XmlDoc/test_XmlDoc.fs @@ -0,0 +1,26 @@ +module ``FSharpQA-Tests-XmlDoc`` + +open NUnit.Framework + +open NUnitConf +open RunPlTest + + + +module Basic = + + [] + let Basic () = runpl |> check + + +module OCamlDoc = + + [] + let OCamlDoc () = runpl |> check + + + +module UnitOfMeasure = + + [] + let UnitOfMeasure () = runpl |> check diff --git a/tests/fsharpqa/Source/nunitConf.fs b/tests/fsharpqa/Source/nunitConf.fs index 9a18413d6c1..f03946bf9ac 100644 --- a/tests/fsharpqa/Source/nunitConf.fs +++ b/tests/fsharpqa/Source/nunitConf.fs @@ -13,17 +13,17 @@ let checkTestResult result = match result with | Success () -> () | Failure (GenericError msg) -> Assert.Fail (msg) - | Failure (ProcessExecError (err, msg)) -> Assert.Fail (sprintf "ERRORLEVEL %i %s" err msg) + | Failure (ProcessExecError (msg1, err, msg2)) -> Assert.Fail (sprintf "%s. ERRORLEVEL %i %s" msg1 err msg2) | Failure (Skipped msg) -> Assert.Ignore(sprintf "skipped. Reason: %s" msg) let checkResult result = match result with - | CmdResult.ErrorLevel err -> let x = err, (sprintf "ERRORLEVEL %d" err) in Failure (RunError.ProcessExecError x) + | CmdResult.ErrorLevel (msg1, err) -> Failure (RunError.ProcessExecError (msg1, err, sprintf "ERRORLEVEL %d" err)) | CmdResult.Success -> Success () let skip msg () = Failure (Skipped msg) let genericError msg () = Failure (GenericError msg) -let errorLevel exitCode msg () = Failure (ProcessExecError (exitCode,msg)) +let errorLevel exitCode msg () = Failure (ProcessExecError ("",exitCode,msg)) let envVars () = System.Environment.GetEnvironmentVariables () @@ -51,7 +51,7 @@ let initializeSuite () = let doNgen = true; - let FSCBinPath = __SOURCE_DIRECTORY__/".."/".."/(sprintf "%O" configurationName)/"net40"/"bin" + let FSCBinPath = __SOURCE_DIRECTORY__/".."/".."/".."/(sprintf "%O" configurationName)/"net40"/"bin" let mapWithDefaults defaults m = Seq.concat [ (Map.toSeq defaults) ; (Map.toSeq m) ] |> Map.ofSeq @@ -65,7 +65,7 @@ let initializeSuite () = | Some confName -> confName | None -> configurationName - processor { + attempt { // do! updateCmd env { Configuration = configurationName; Ngen = doNgen; } // |> Attempt.Run // |> function Success () -> Success () | Failure msg -> genericError msg () @@ -81,7 +81,7 @@ let initializeSuite () = // let directoryExists = Commands.directoryExists (Path.GetTempPath()) >> Option.isSome // -// let checkfscBinPath () = processor { +// let checkfscBinPath () = attempt { // // let fscBinPath = cfg.EnvironmentVariables |> Map.tryFind "FSCBINPATH" // return! @@ -91,7 +91,7 @@ let initializeSuite () = // | Some dir -> genericError (sprintf "environment variable 'FSCBinPath' is required to be a valid directory, but is '%s'" dir) // } // -// let smokeTest () = processor { +// let smokeTest () = attempt { // let tempFile ext = // let p = Path.ChangeExtension( Path.GetTempFileName(), ext) // File.AppendAllText (p, """printfn "ciao"; exit 0""") @@ -241,6 +241,12 @@ type EnvLstLineTestCaseAttribute = open EnvLst +let logDiscover format = + let p = Path.Combine(__SOURCE_DIRECTORY__, "nunit_discover.log") + Printf.ksprintf (fun s -> File.AppendAllLines(p, [| s |])) format + + + type FSharpQASuiteTestAttribute(dir: string) = inherit NUnitAttribute() @@ -250,6 +256,17 @@ type FSharpQASuiteTestAttribute(dir: string) = let rootDir = __SOURCE_DIRECTORY__ let path = Path.Combine(Path.Combine(rootDir, dir), "env.lst") +#if DEBUG + //log to file + let log = logDiscover +#endif + + log "discover: %s" path + + if not (File.Exists(path)) then + log "Expected env.lst file '%s' not found" path + failwithf "Expected env.lst file '%s' not found" path + let lines = path |> IO.File.ReadAllLines @@ -266,8 +283,10 @@ type FSharpQASuiteTestAttribute(dir: string) = match lines |> Array.choose (function l, Choice1Of2(Some(EnvLstLine.Data(d))) -> Some(l,d) | _ -> None) with | [| |] -> + log "No valid lines inside env.lst file '%s'" path failwithf "No valid lines inside env.lst file '%s'" path | validLines -> + log "ok: '%s'" path validLines |> Array.map (fun (line,data) -> let tc = EnvLstLineTestCaseData (dir, line) @@ -317,7 +336,7 @@ module FileGuard = let exists (guard: T) = guard.Path |> File.Exists -let checkGuardExists guard = processor { +let checkGuardExists guard = attempt { if not <| (guard |> FileGuard.exists) then return! genericError (sprintf "exit code 0 but %s file doesn't exists" (guard.Path |> Path.GetFileName)) } diff --git a/tests/fsharpqa/Source/run.fs b/tests/fsharpqa/Source/run.fs index 58b17b34693..ae20a4beb01 100644 --- a/tests/fsharpqa/Source/run.fs +++ b/tests/fsharpqa/Source/run.fs @@ -14,6 +14,49 @@ let (|Regex|_|) pattern input = else None let lc (s: string) = s.ToLower() +let stringReplace (a: string) b (s: string) = s.Replace(a, b) + +//reality check: it's xml like, but not valid xml +let parseMalformedXml (s: string) = + try + //first, try parse as valid xml, if works, that's ok + Choice1Of2 (System.Xml.Linq.XElement.Parse(s)) + with e -> + let regexReplace (tag: string) (i: string) = + let p = sprintf @"(?<%s.*?>)(?.*?)(?<\/%s.*?>)" tag tag + let r = @"${open}${close}" + Regex.Replace(i, p, r) + //maybe is malformed xml, so let's CDATA the inner text + let s2 = + s + |> regexReplace "Expect" + |> regexReplace "CmdLine" + try + //and retry + Choice1Of2 (System.Xml.Linq.XElement.Parse(s2)) + with e -> + Choice2Of2 e + +let skipIfContainsRedirection varName (exe, cmdArgs: string) = attempt { + if cmdArgs.Contains(">") then + return! NUnitConf.skip (sprintf "output/error redirection is not implemented. Var %s => '%s %s'" varName exe cmdArgs) + } + + +type RunPlConfig = { + compileOnlyRun: bool + VerifyStrongName: bool + SCFLAGS: string option + TAILFLAGS: string option + ISCFLAGS: string + IFSIFLAGS: string + FSC_PIPE: string + FSI_PIPE: string + FSI32_PIPE: string + CSC_PIPE: string + VBC_PIPE: string + envVars: Map + } (** PERL NOTES @@ -130,9 +173,11 @@ let RunCommand cwd envVars msg (exe, cmdArgs) dumpOutput = attempt { //open(COMMAND,"$cmd 2>&1 |") or RunExit(TEST_FAIL, "Command Process Couldn't Be Created: $! Returned $? \n"); //@CommandOutput = ; //close COMMAND; + let exePath = if fileExists exe |> Option.isSome then exe |> getfullpath else exe + let tempOut = IO.Path.GetTempFileName() - let result = ``exec 2>1 1>a`` tempOut exe cmdArgs - let cmdExitCode = match result with CmdResult.ErrorLevel(x) -> x | CmdResult.Success -> 0 + let result = ``exec 2>1 1>a`` tempOut exePath cmdArgs + let cmdExitCode = match result with CmdResult.ErrorLevel(_, x) -> x | CmdResult.Success -> 0 let CommandOutput = tempOut |> IO.File.ReadAllText // # close STDERR; open STDERR, ">&SAVEERR"; #resore stderr @@ -229,7 +274,7 @@ let GetSrc cwd (envVarSOURCE: string) = attempt { let mutable s = envVarSOURCE //s/\$CWD/$cwd/; - s <- s.Replace("$CWD", cwd) + s <- s.Replace(@"\$CWD", cwd) //my $source = $_; let source = s @@ -366,12 +411,8 @@ let GetExpectedResults cwd (srcListSepByBlank: string) = //push @dontmatch, "internal error"; ignore "useless, it's a failfast" - //let's simplify a bit the loop below, it's xml after // - let parseXml (s: string) = - try - Choice1Of2 (System.Xml.Linq.XElement.Parse(s)) - with e -> - Choice2Of2 e + //let's simplify a bit the loop below, it's xml like after // + let parseXml = parseMalformedXml //ITEM: while() { SRC () @@ -630,7 +671,7 @@ let GetExpectedTargetInfo cwd (_sources: string) _SCFLAGS = attempt { do match _SCFLAGS with //if ($_SCFLAGS =~ /.*(--target:|-a)((\w*)|$)/i) { - | Regex @".*(--target:|-a)((\w*)|$)" [ d1; d2 ] -> + | Regex @".*(--target:|-a)((\w*)|$)" [ d1; d2; _d3 ] -> // #figure out targetname from SCFLAGS //if("$1" eq "-a") { if (d1 = "-a") then @@ -711,59 +752,79 @@ let LogTime logFile src (compileTime: TimeSpan) (runTime: TimeSpan) = // # RunExit -- Exits the script with the specified value. // # //sub RunExit { -let RunExit envPOSTCMD (exitVal: int) (cmtStr: string) = attempt { +let RunExit cmdsOverride cwd (cfg: RunPlConfig) = attempt { //my ( // $exitVal, # Our exit value // $cmtStr, # Comment string to print before exit // ) = @_; - ignore "are arguments" + ignore "$exitVal is useless, we use NUnit results, not int exit code" + ignore "$cmtStr is useless, was the skip/error message, already managed by attempt and NUnitConf.genericError/skip" + + let env key = cfg.envVars |> Map.tryFind key + + //shadow some function, to have same argument as perl script + let RunCommand = RunCommand cwd cfg.envVars //my %status_hash = ( // 0 => "PASS", // 1 => "FAIL", // 2 => "SKIP" // ); - let status_hash = - [ 0, "PASS" - 1, "FAIL" - 2, "SKIP" ] - |> Map.ofList + ignore "unused" //print("$cmtStr") if ($cmtStr); - do if (not(System.String.IsNullOrWhiteSpace(cmtStr))) then - printf "%s" cmtStr + ignore "useless" //my $exit_str; let exit_str = "" //my $test_result = $exitVal; - let test_result = exitVal + ignore "useless" // # Run POSTCMD if any //if (defined($ENV{POSTCMD})) { - do! if (not(System.String.IsNullOrWhiteSpace(envPOSTCMD))) then - // # Do the magic to replace known tokens in the - // # PRECMD/POSTCMD: for now you can write in env.lst - // # something like: - // # SOURCE=foo.fs POSTCMD="\$FSC_PIPE bar.fs" - // # and it will expanded into $FSC_PIPE before invoking it - //$_ = $ENV{POSTCMD}; - //s/^\$FSC_PIPE/$FSC_PIPE/; - //s/^\$FSI_PIPE/$FSI_PIPE/; - //s/^\$FSI32_PIPE/$FSI32_PIPE/; - //s/^\$CSC_PIPE/$CSC_PIPE/; - //s/^\$VBC_PIPE/$VBC_PIPE/; - TODO "implement replace" + do! match env "POSTCMD" with + | None -> Success + | Some envPOSTCMD -> + match cmdsOverride envPOSTCMD with + | Some cmdImpl -> + printfn "using override for '%s'" envPOSTCMD + cmdImpl cwd cfg + | None -> attempt { + // # Do the magic to replace known tokens in the + // # PRECMD/POSTCMD: for now you can write in env.lst + // # something like: + // # SOURCE=foo.fs POSTCMD="\$FSC_PIPE bar.fs" + // # and it will expanded into $FSC_PIPE before invoking it + //$_ = $ENV{POSTCMD}; + + let post = + envPOSTCMD + //s/^\$FSC_PIPE/$FSC_PIPE/; + |> stringReplace "\\$FSC_PIPE" cfg.FSC_PIPE + //s/^\$FSI_PIPE/$FSI_PIPE/; + |> stringReplace "\\$FSI_PIPE" cfg.FSI_PIPE + //s/^\$FSI32_PIPE/$FSI32_PIPE/; + |> stringReplace "\\$FSI32_PIPE" cfg.FSI32_PIPE + //s/^\$CSC_PIPE/$CSC_PIPE/; + |> stringReplace "\\$CSC_PIPE" cfg.CSC_PIPE + //s/^\$VBC_PIPE/$VBC_PIPE/; + |> stringReplace "\\$VBC_PIPE" cfg.VBC_PIPE - //if (RunCommand("POSTCMD",$_,1)){ - // $exitVal = TEST_FAIL; - // $test_result = TEST_FAIL; - // $exit_str .= "Fail to execute the POSTCMD. "; - //} - TODO "implement POSTCMD" + let exe, cmdArgs = post |> splitAtFirst Char.IsWhiteSpace + let cmdArgsString = cmdArgs |> function Some s -> s | None -> "" - NUnitConf.skip "POSTCMD not implemented" - else - Success + do! skipIfContainsRedirection "POSTCMD" (exe, cmdArgsString) + + //if (RunCommand("POSTCMD",$_,1)){ + // $exitVal = TEST_FAIL; + // $test_result = TEST_FAIL; + // $exit_str .= "Fail to execute the POSTCMD. "; + //} + let! e,o = RunCommand "POSTCMD" (exe, cmdArgsString) true + if e <> 0 + then return! NUnitConf.genericError (sprintf "Fail to execute the POSTCMD %s" o) + + } //} //if (exists($ENV{SKIPTEST})) { @@ -803,10 +864,12 @@ let RunExit envPOSTCMD (exitVal: int) (cmtStr: string) = attempt { TODO "implement SKIP? or it's the runner filter?" //print $exit_str . $status_hash{$test_result} . "\n"; - printfn "%s %s" exit_str (status_hash |> Map.find test_result) + ignore "nunit already has output" //exit($exitVal); - return exitVal + ignore "nunit result are used, not int exit codes" + + return () } // ############################################################# @@ -837,7 +900,7 @@ let GetCurrentPlatform () = ignore "useless, it's calculated from another function" -let runpl cwd initialEnvVars = attempt { +let readRunplConfig cwd initialEnvVars = attempt { let mutable envVars = initialEnvVars @@ -857,11 +920,9 @@ let runpl cwd initialEnvVars = attempt { let GetExpectedTargetInfo = GetExpectedTargetInfo cwd let GetExpectedResults = GetExpectedResults cwd - let LogTime = - //my($dir) = $main::root; - //open(TIMELOGFILE, ">>$dir\\timing.log"); - let logFile = __SOURCE_DIRECTORY__ ++ "timing.log" - LogTime logFile + //my($dir) = $main::root; + //open(TIMELOGFILE, ">>$dir\\timing.log"); + ignore "useless, done by nunit" // # run.pl @@ -1016,11 +1077,39 @@ let runpl cwd initialEnvVars = attempt { let VBC_PIPE = envOrDefault "VBC_PIPE" VBC_NAME envSet "VBC_PIPE" VBC_PIPE - let skipIfContainsRedirection varName (exe, cmdArgs: string) = attempt { - if cmdArgs.Contains(">") then - return! NUnitConf.skip (sprintf "output/error redirection is not implemented. Var %s => '%s %s'" varName exe cmdArgs) - } + return { compileOnlyRun = compileOnlyRun + VerifyStrongName = VerifyStrongName + SCFLAGS = SCFLAGS + TAILFLAGS = TAILFLAGS + ISCFLAGS = ISCFLAGS + IFSIFLAGS = IFSIFLAGS + FSC_PIPE = FSC_PIPE + FSI_PIPE = FSI_PIPE + FSI32_PIPE = FSI32_PIPE + CSC_PIPE = CSC_PIPE + VBC_PIPE = VBC_PIPE + envVars = envVars } + } + +let runplImpl cmdsOverride cwd (cfg: RunPlConfig) = attempt { + + let mutable envVars = cfg.envVars + + let env key = envVars |> Map.tryFind key + let envOrDefault key def = env key |> Option.fold (fun s t -> t) def + let envOrFail key = env key |> function Some x -> x | None -> failwithf "environment variable '%s' required " key + + let unlink = Commands.rm cwd + let fileExists = Commands.fileExists cwd + let getfullpath = Commands.getfullpath cwd + + //shadow some function, to have same argument as perl script + let RunCommand = RunCommand cwd envVars + let RunCompilerCommand = RunCompilerCommand cwd envVars + let GetExpectedTargetInfo = GetExpectedTargetInfo cwd + let GetExpectedResults = GetExpectedResults cwd + //# //# Run pre-command if any @@ -1028,39 +1117,43 @@ let runpl cwd initialEnvVars = attempt { //if (exists($ENV{PRECMD})) { do! match env "PRECMD" with | None -> Success - | Some envPRECMD -> attempt { - let replace (a: string) b (s: string) = s.Replace(a, b) - // # Do the magic to replace known tokens in the - // # PRECMD/POSTCMD: for now you can write in env.lst - // # something like: - // # SOURCE=foo.fs PRECMD="\$FSC_PIPE bar.fs" - // # and it will expanded into $FSC_PIPE before invoking it - //$_ = $ENV{PRECMD}; - let pre = - envPRECMD - //s/^\$FSC_PIPE/$FSC_PIPE/; - |> replace "$FSC_PIPE" FSC_PIPE - //s/^\$FSI_PIPE/$FSI_PIPE/; - |> replace "$FSI_PIPE" FSI_PIPE - //s/^\$FSI32_PIPE/$FSI32_PIPE/; - |> replace "$FSI32_PIPE" FSI32_PIPE - //s/\$ISCFLAGS/$ISCFLAGS/; - |> replace "$ISCFLAGS" ISCFLAGS - //s/^\$CSC_PIPE/$CSC_PIPE/; - |> replace "$CSC_PIPE" CSC_PIPE - //s/^\$VBC_PIPE/$VBC_PIPE/; - |> replace "$VBC_PIPE" VBC_PIPE - - let exe, cmdArgs = pre |> splitAtFirst Char.IsWhiteSpace - let cmdArgsString = cmdArgs |> function Some s -> s | None -> "" - - do! skipIfContainsRedirection "PRECMD" (exe, cmdArgsString) - - let! e,o = RunCommand "PRECMD" (exe, cmdArgsString) true - //RunExit(TEST_FAIL, "Fail to execute the PRECMD" . @CommandOutput . "\n") if RunCommand("PRECMD",$_ ,1); - if e <> 0 - then return! NUnitConf.genericError (sprintf "Fail to execute the PRECMD %s" o) - } + | Some envPRECMD -> + match cmdsOverride envPRECMD with + | Some cmdImpl -> + printfn "using override for '%s'" envPRECMD + cmdImpl cwd cfg + | None -> attempt { + // # Do the magic to replace known tokens in the + // # PRECMD/POSTCMD: for now you can write in env.lst + // # something like: + // # SOURCE=foo.fs PRECMD="\$FSC_PIPE bar.fs" + // # and it will expanded into $FSC_PIPE before invoking it + //$_ = $ENV{PRECMD}; + let pre = + envPRECMD + //s/^\$FSC_PIPE/$FSC_PIPE/; + |> stringReplace "\\$FSC_PIPE" cfg.FSC_PIPE + //s/^\$FSI_PIPE/$FSI_PIPE/; + |> stringReplace "\\$FSI_PIPE" cfg.FSI_PIPE + //s/^\$FSI32_PIPE/$FSI32_PIPE/; + |> stringReplace "\\$FSI32_PIPE" cfg.FSI32_PIPE + //s/\$ISCFLAGS/$ISCFLAGS/; + |> stringReplace "\\$ISCFLAGS" cfg.ISCFLAGS + //s/^\$CSC_PIPE/$CSC_PIPE/; + |> stringReplace "\\$CSC_PIPE" cfg.CSC_PIPE + //s/^\$VBC_PIPE/$VBC_PIPE/; + |> stringReplace "\\$VBC_PIPE" cfg.VBC_PIPE + + let exe, cmdArgs = pre |> splitAtFirst Char.IsWhiteSpace + let cmdArgsString = cmdArgs |> function Some s -> s | None -> "" + + do! skipIfContainsRedirection "PRECMD" (exe, cmdArgsString) + + let! e,o = RunCommand "PRECMD" (exe, cmdArgsString) true + //RunExit(TEST_FAIL, "Fail to execute the PRECMD" . @CommandOutput . "\n") if RunCommand("PRECMD",$_ ,1); + if e <> 0 + then return! NUnitConf.genericError (sprintf "Fail to execute the PRECMD %s" o) + } //} //# Normal testing begins @@ -1091,7 +1184,7 @@ let runpl cwd initialEnvVars = attempt { match env "FSIMODE" with | None | Some "" -> //$compiler_command = "$FSC_PIPE $ISCFLAGS $SCFLAGS $Sources $TAILFLAGS"; - return FSC_PIPE, [ Some ISCFLAGS; SCFLAGS; Some sources; TAILFLAGS ] |> concatEmpty + return cfg.FSC_PIPE, [ Some cfg.ISCFLAGS; cfg.SCFLAGS; Some sources; cfg.TAILFLAGS ] |> concatEmpty //} else { | Some _ -> // # don't use hosted compiler for FSI tests @@ -1105,15 +1198,15 @@ let runpl cwd initialEnvVars = attempt { //} elsif($ENV{FSIMODE} eq "EXEC") { | Some "EXEC" -> //$compiler_command = "$FSI_PIPE --exec $IFSIFLAGS $SCFLAGS $Sources $TAILFLAGS"; - return FSI_PIPE, [ Some "--exec"; Some IFSIFLAGS; SCFLAGS; Some sources; TAILFLAGS ] |> concatEmpty + return cfg.FSI_PIPE, [ Some "--exec"; Some cfg.IFSIFLAGS; cfg.SCFLAGS; Some sources; cfg.TAILFLAGS ] |> concatEmpty //} elsif($ENV{FSIMODE} eq "FEED") { | Some "FEED" -> //$compiler_command = "$FSI_PIPE $IFSIFLAGS $SCFLAGS $Sources $TAILFLAGS"; - return FSI_PIPE, [ Some IFSIFLAGS; SCFLAGS; Some sources; TAILFLAGS ] |> concatEmpty + return cfg.FSI_PIPE, [ Some cfg.IFSIFLAGS; cfg.SCFLAGS; Some sources; cfg.TAILFLAGS ] |> concatEmpty //} else { # default to FEED | _ -> //$compiler_command = "$FSI_PIPE $IFSIFLAGS $SCFLAGS $Sources $TAILFLAGS"; - return FSI_PIPE, [ Some IFSIFLAGS; SCFLAGS; Some sources; TAILFLAGS ] |> concatEmpty + return cfg.FSI_PIPE, [ Some cfg.IFSIFLAGS; cfg.SCFLAGS; Some sources; cfg.TAILFLAGS ] |> concatEmpty //} //} } @@ -1206,7 +1299,7 @@ let runpl cwd initialEnvVars = attempt { NUnitConf.genericError (sprintf "expect not match failed: %A" matched) //my ($targetName, $targetType) = &GetExpectedTargetInfo($Sources, $SCFLAGS); - let! targetName, targetType = GetExpectedTargetInfo sources (SCFLAGS |> function Some s -> s | None -> "") + let! targetName, targetType = GetExpectedTargetInfo sources (cfg.SCFLAGS |> function Some s -> s | None -> "") //if ($ExitCode && ($Type < TEST_SEEK_ERROR)) { do! if ((exitCode <> 0) && (Type < TEST_SEEK_ERROR)) then @@ -1228,252 +1321,270 @@ let runpl cwd initialEnvVars = attempt { //} - //if ($ExitCode) { - do! if (exitCode <> 0) then - //RunExit(TEST_SKIPPED, "Internal Logic Error(1)") if ($Type != TEST_SEEK_ERROR); - if (Type <> TEST_SEEK_ERROR) then - //RunExit(TEST_SKIPPED, "Internal Logic Error(1)") - NUnitConf.skip "Internal Logic Error(1)" + let notExpectedToError () = attempt { + //RunExit(TEST_SKIPPED, "Internal Logic Error(2)") if ($Type == TEST_SEEK_ERROR); + do! if (Type = TEST_SEEK_ERROR) then + NUnitConf.skip "Internal Logic Error(2)" else - //RunExit(TEST_PASS); # Designed to fail, and it did - ignore "make it pass, it's going to be a big if" - NUnitConf.genericError "Not implemented: Designed to fail, and it did" - else - Success - //} - - //RunExit(TEST_SKIPPED, "Internal Logic Error(2)") if ($Type == TEST_SEEK_ERROR); - do! if (Type = TEST_SEEK_ERROR) then - NUnitConf.skip "Internal Logic Error(2)" - else - Success + Success - //RunExit(TEST_SKIPPED, "Internal Logic Error(3)") if ($ExitCode); - do! if (exitCode <> 0) then - NUnitConf.skip "Internal Logic Error(3)" - else - Success + //RunExit(TEST_SKIPPED, "Internal Logic Error(3)") if ($ExitCode); + do! if (exitCode <> 0) then + NUnitConf.skip "Internal Logic Error(3)" + else + Success - //if($ENV{REDUCED_RUNTIME} ne "1"){ - do! match env "REDUCED_RUNTIME" with - | Some "1" -> - Success - | _ -> - //if((defined $targetName) && (defined $targetType)) { - // # check/set PEVerify - // my $PEVERIFY = $ENV{PEVERIFY}; - // unless(defined($PEVERIFY)) { - // # Only use peverify if it is in the path - // foreach $_ (split /;/, $ENV{PATH}) { - // $PEVERIFY = "peverify.exe" if(-e "$_\\peverify.exe"); - // } - // $ENV{PEVERIFY} = $PEVERIFY; - // } - // - // # Use $ENV{PEVER} if it is defined - // my $PEVER_ARG = $ENV{PEVER}; - // - //if (!defined($PEVERIFY)) { - // print "PEVerify ($PEVERIFY) not defined/found, skipping...\n"; - //} elsif ($PEVER_ARG =~ /\/Exp_Fail/i) { - // # do not run if Exp_Fail - // print "PEVerify not run because test is marked as an expected failure...\n"; - // } elsif($targetType <= TARGET_DLL) { - // RunExit(TEST_FAIL, "PeVerify Failed the test\n") if (RunCommand("Peverify","$PEVERIFY $targetName $ENV{PEVER}",1)); - // } - //} - TODO "REDUCED_RUNTIME <> 1 not implemented" - NUnitConf.skip "REDUCED_RUNTIME not implemented" - //} + //if($ENV{REDUCED_RUNTIME} ne "1"){ + do! match env "REDUCED_RUNTIME" with + | Some "1" -> + Success + | _ -> + //if((defined $targetName) && (defined $targetType)) { + // # check/set PEVerify + // my $PEVERIFY = $ENV{PEVERIFY}; + // unless(defined($PEVERIFY)) { + // # Only use peverify if it is in the path + // foreach $_ (split /;/, $ENV{PATH}) { + // $PEVERIFY = "peverify.exe" if(-e "$_\\peverify.exe"); + // } + // $ENV{PEVERIFY} = $PEVERIFY; + // } + // + // # Use $ENV{PEVER} if it is defined + // my $PEVER_ARG = $ENV{PEVER}; + // + //if (!defined($PEVERIFY)) { + // print "PEVerify ($PEVERIFY) not defined/found, skipping...\n"; + //} elsif ($PEVER_ARG =~ /\/Exp_Fail/i) { + // # do not run if Exp_Fail + // print "PEVerify not run because test is marked as an expected failure...\n"; + // } elsif($targetType <= TARGET_DLL) { + // RunExit(TEST_FAIL, "PeVerify Failed the test\n") if (RunCommand("Peverify","$PEVERIFY $targetName $ENV{PEVER}",1)); + // } + //} + TODO "REDUCED_RUNTIME <> 1 not implemented" + NUnitConf.skip "REDUCED_RUNTIME not implemented" + //} - // ################################################################################ - // # - // # Running the EXE - // # - // # Now we scan the output of the EXE if we must - let checkRunningExe expectedExeOutput () = attempt { + // ################################################################################ + // # + // # Running the EXE + // # + // # Now we scan the output of the EXE if we must + let checkRunningExe expectedExeOutput () = attempt { - //my $status = TEST_PASS; - let status = TEST_PASS - //my $param = ""; - let mutable param = "" - //RunExit(TEST_FAIL, "Failed to Find Any Target: $targetName \n") unless ( -e $targetName ); - do! match fileExists targetName with - | None -> - NUnitConf.genericError (sprintf "Failed to Find Any Target: %s \n" targetName) - | Some _ -> - Success + //my $status = TEST_PASS; + let status = TEST_PASS + //my $param = ""; + let mutable param = "" + //RunExit(TEST_FAIL, "Failed to Find Any Target: $targetName \n") unless ( -e $targetName ); + do! match fileExists targetName with + | None -> + NUnitConf.genericError (sprintf "Failed to Find Any Target: %s \n" targetName) + | Some _ -> + Success - //$param = $CmdLine if defined($CmdLine); - TODO "$CmdLine is declare, but it's not initialized before" + //$param = $CmdLine if defined($CmdLine); + TODO "$CmdLine is declare, but it's not initialized before" - //@CommandOutput = (); - ignore "unused, the CommandOutput now is a return value" + //@CommandOutput = (); + ignore "unused, the CommandOutput now is a return value" - //my($StartTime) = time(); - let StartTime = System.Diagnostics.Stopwatch.StartNew(); + //my($StartTime) = time(); + let StartTime = System.Diagnostics.Stopwatch.StartNew(); - //# For /3Gb runs, we need to mark exe with /LARGEADDRESSAWARE - let markLargAddress exeName = attempt { - //RunCommand("Marking exe with /LARGEADDRESSAWARE...","editbin.exe /LARGEADDRESSAWARE $targetName"); - let! e,o = RunCommand "Marking exe with /LARGEADDRESSAWARE..." ("editbin.exe", (sprintf "/LARGEADDRESSAWARE %s" exeName)) false - if e <> 0 then - return! NUnitConf.errorLevel e (sprintf "Failed mark exe with /LARGEADDRESSAWARE: %s" o) - } - - //if(defined($ENV{LARGEADDRESSAWARE})) { - do! if env "LARGEADDRESSAWARE" |> Option.isSome then - markLargAddress targetName - else - Success - //} + //# For /3Gb runs, we need to mark exe with /LARGEADDRESSAWARE + let markLargAddress exeName = attempt { + //RunCommand("Marking exe with /LARGEADDRESSAWARE...","editbin.exe /LARGEADDRESSAWARE $targetName"); + let! e,o = RunCommand "Marking exe with /LARGEADDRESSAWARE..." ("editbin.exe", (sprintf "/LARGEADDRESSAWARE %s" exeName)) false + if e <> 0 then + return! NUnitConf.errorLevel e (sprintf "Failed mark exe with /LARGEADDRESSAWARE: %s" o) + } + + //if(defined($ENV{LARGEADDRESSAWARE})) { + do! if env "LARGEADDRESSAWARE" |> Option.isSome then + markLargAddress targetName + else + Success + //} - //my $sim = ""; - ignore "unused variable" + //my $sim = ""; + ignore "unused variable" - let! exePath = - //if (defined($ENV{SIMULATOR_PIPE})) { - if env "SIMULATOR_PIPE" |> Option.isSome then - //# replace known tokens - //$_ = $ENV{SIMULATOR_PIPE}; - //s/^\$FSC_PIPE/$FSC_PIPE/; - //s/^\$FSI_PIPE/$FSI_PIPE/; - //s/^\$FSI32_PIPE/$FSI32_PIPE/; - //s/\$ISCFLAGS/$ISCFLAGS/; - //s/^\$CSC_PIPE/$CSC_PIPE/; - //s/^\$VBC_PIPE/$VBC_PIPE/; - //s/\$PLATFORM/$ENV{PLATFORM}/; - TODO "replace variables" + let! exePath = + //if (defined($ENV{SIMULATOR_PIPE})) { + if env "SIMULATOR_PIPE" |> Option.isSome then + //# replace known tokens + //$_ = $ENV{SIMULATOR_PIPE}; + //s/^\$FSC_PIPE/$FSC_PIPE/; + //s/^\$FSI_PIPE/$FSI_PIPE/; + //s/^\$FSI32_PIPE/$FSI32_PIPE/; + //s/\$ISCFLAGS/$ISCFLAGS/; + //s/^\$CSC_PIPE/$CSC_PIPE/; + //s/^\$VBC_PIPE/$VBC_PIPE/; + //s/\$PLATFORM/$ENV{PLATFORM}/; + TODO "replace variables" - //$sim = $_; - //$ExitCode = RunCommand("Running","$sim $targetName $param"); - TODO "SIMULATOR_PIPE not supported, it's not used in fsharpqa tests" + //$sim = $_; + //$ExitCode = RunCommand("Running","$sim $targetName $param"); + TODO "SIMULATOR_PIPE not supported, it's not used in fsharpqa tests" - NUnitConf.skip "var SIMULATOR_PIPE not supported" - //} - else - let exePath = targetName |> getfullpath - succeed exePath + NUnitConf.skip "var SIMULATOR_PIPE not supported" + //} + else + let exePath = targetName |> getfullpath + succeed exePath - do! skipIfContainsRedirection "SOURCE" (exePath, param) + do! skipIfContainsRedirection "SOURCE" (exePath, param) - //$ExitCode = RunCommand("Running","$sim $targetName $param"); - //NOTE there the $sim is blank - let! exitCode, commandOutput = RunCommand "Running" (exePath, param) false + //$ExitCode = RunCommand("Running","$sim $targetName $param"); + //NOTE there the $sim is blank + let! exitCode, commandOutput = RunCommand "Running" (exePath, param) false - //my($DeltaTime) = time() - $StartTime; - let DeltaTime = StartTime.Elapsed - - //LogTime($Sources, $CompileTime, $DeltaTime) if ($TimeTests); - do if TimeTests then - LogTime sources CompileTime DeltaTime + //my($DeltaTime) = time() - $StartTime; + let DeltaTime = StartTime.Elapsed + //LogTime($Sources, $CompileTime, $DeltaTime) if ($TimeTests); + ignore "useless, done by nunit" - //my $check_output = scalar(@{$Output}); + //my $check_output = scalar(@{$Output}); - //my ($LinesMatched) = 0; - //my ($LinesToMatch) = $check_output; - // - //#parse the output - //foreach (@CommandOutput) { - // if ($check_output) { - // my $line = shift @{$Output}; - // chop $line eq "\n" || RunExit(TEST_SKIPPED, "Internal error in perl script, expecting newline in \$line \n"); - // chop $_ eq "\n" || RunExit(TEST_SKIPPED, "Internal error in perl script, expecting newline in \$_ \n"); - // - // if (((length($_) == 0) && (length($line) == 0)) || - // (($_ =~ /$line/) && (length($line) != 0))) { - // # The good - // print("[matched] $_\n"); - // $LinesMatched++; - // } else { - // # The bad - // print(" Error: Expected: [$line]\n"); - // print(" Error: Received: [$_]\n\n"); - // $status = TEST_FAIL; - // } - // - // $check_output = scalar(@{$Output}); - // } else { - // # redirect outputs from the exe to runpl.log - // print; - // } - //} - //print("\n"); - do! match expectedExeOutput with - | None -> - Success - | Some [] -> - Success - | Some (x :: xs) -> - let possible = - commandOutput.Split([| System.Environment.NewLine |], StringSplitOptions.RemoveEmptyEntries) - |> Array.skipWhile ((<>) x) - |> Array.truncate (x::xs |> List.length) - |> List.ofArray - - if (x :: xs) = possible then - printfn "Output match: [passed]" + //my ($LinesMatched) = 0; + //my ($LinesToMatch) = $check_output; + // + //#parse the output + //foreach (@CommandOutput) { + // if ($check_output) { + // my $line = shift @{$Output}; + // chop $line eq "\n" || RunExit(TEST_SKIPPED, "Internal error in perl script, expecting newline in \$line \n"); + // chop $_ eq "\n" || RunExit(TEST_SKIPPED, "Internal error in perl script, expecting newline in \$_ \n"); + // + // if (((length($_) == 0) && (length($line) == 0)) || + // (($_ =~ /$line/) && (length($line) != 0))) { + // # The good + // print("[matched] $_\n"); + // $LinesMatched++; + // } else { + // # The bad + // print(" Error: Expected: [$line]\n"); + // print(" Error: Received: [$_]\n\n"); + // $status = TEST_FAIL; + // } + // + // $check_output = scalar(@{$Output}); + // } else { + // # redirect outputs from the exe to runpl.log + // print; + // } + //} + //print("\n"); + do! match expectedExeOutput with + | None -> Success - else - printfn "Output match: [failed]" - printfn "Output:" - printfn "%s" commandOutput - NUnitConf.genericError "exe output doesnt match" + | Some [] -> + Success + | Some (x :: xs) -> + let possible = + commandOutput.Split([| System.Environment.NewLine |], StringSplitOptions.RemoveEmptyEntries) + |> Array.skipWhile ((<>) x) + |> Array.truncate (x::xs |> List.length) + |> List.ofArray + + if (x :: xs) = possible then + printfn "Output match: [passed]" + Success + else + printfn "Output match: [failed]" + printfn "Output:" + printfn "%s" commandOutput + NUnitConf.genericError "exe output doesnt match" - //RunExit(TEST_FAIL, "Generated Test EXE Failed \n") if ($ExitCode); - do! if (exitCode <> 0) then - NUnitConf.genericError "Generated Test EXE Failed" - else - Success + //RunExit(TEST_FAIL, "Generated Test EXE Failed \n") if ($ExitCode); + do! if (exitCode <> 0) then + NUnitConf.genericError "Generated Test EXE Failed" + else + Success - //RunExit(TEST_FAIL, "Test EXE had bad output \n") if ($status != TEST_PASS); - do! if (status <> TEST_PASS) then - NUnitConf.genericError "Test EXE had bad output" - else - Success + //RunExit(TEST_FAIL, "Test EXE had bad output \n") if ($status != TEST_PASS); + do! if (status <> TEST_PASS) then + NUnitConf.genericError "Test EXE had bad output" + else + Success - //RunExit(TEST_FAIL, "Test EXE had bad output \n") if ($LinesMatched != $LinesToMatch); - TODO "match ouput" - //} - } + //RunExit(TEST_FAIL, "Test EXE had bad output \n") if ($LinesMatched != $LinesToMatch); + TODO "match ouput" + //} + } - let checkVerifyStrongName () = attempt { - let verifyStrongName () = attempt { - //RunExit(TEST_FAIL, "Assembly failed verification:\n") if RunCommand("VerifyStroingName","sn -q -vf $targetName",1); - let! e,_ = RunCommand "VerifyStroingName" ("sn", "-q -vf $targetName") true - if e <> 0 then - return! NUnitConf.genericError "Assembly failed verification:\n" - } + let checkVerifyStrongName () = attempt { + let verifyStrongName () = attempt { + //RunExit(TEST_FAIL, "Assembly failed verification:\n") if RunCommand("VerifyStroingName","sn -q -vf $targetName",1); + let! e,_ = RunCommand "VerifyStroingName" ("sn", "-q -vf $targetName") true + if e <> 0 then + return! NUnitConf.genericError "Assembly failed verification:\n" + } - //if ($VerifyStrongName && $targetType <= TARGET_MOD) { - if VerifyStrongName && (targetType <= TARGET_MOD) then - return! verifyStrongName() - } - //} + //if ($VerifyStrongName && $targetType <= TARGET_MOD) { + if cfg.VerifyStrongName && (targetType <= TARGET_MOD) then + return! verifyStrongName() + } + //} - let expectedExeOutput = - dd |> List.tryPick (function ExeOutputMatch(l) -> Some l | _ -> None) + let expectedExeOutput = + dd |> List.tryPick (function ExeOutputMatch(l) -> Some l | _ -> None) - // # If this is a compile only run, call post command and exit - //if ($compileOnlyRun) { - return! - if compileOnlyRun then - Success - else attempt { - //if ($targetType == TARGET_EXE) { - do! if targetType = TARGET_EXE then - checkRunningExe expectedExeOutput () - else - Success + // # If this is a compile only run, call post command and exit + //if ($compileOnlyRun) { + return! + if cfg.compileOnlyRun then + Success + else attempt { + //if ($targetType == TARGET_EXE) { + do! if targetType = TARGET_EXE then + checkRunningExe expectedExeOutput () + else + Success - return! checkVerifyStrongName () - } + return! checkVerifyStrongName () + } + //} + } + + //if ($ExitCode) { + return! + if (exitCode <> 0) then + //RunExit(TEST_SKIPPED, "Internal Logic Error(1)") if ($Type != TEST_SEEK_ERROR); + if (Type <> TEST_SEEK_ERROR) then + //RunExit(TEST_SKIPPED, "Internal Logic Error(1)") + NUnitConf.skip "Internal Logic Error(1)" + else + //RunExit(TEST_PASS); # Designed to fail, and it did + printfn "Designed to fail, and it did" + Success + else + notExpectedToError () //} //exit (1); #safe stop //safe stop - + } + + +let runpl cmdOverride cwd initialEnvVars = attempt { + let! cfg = readRunplConfig cwd initialEnvVars + + let cfg2 = TestConfig.config cfg.envVars + + let cfg = + { cfg with + envVars = cfg.envVars + |> Map.add "ILDASM" cfg2.ILDASM } + + do! runplImpl cmdOverride cwd cfg + + //test is ok, let's check runExit + return! RunExit cmdOverride cwd cfg + } diff --git a/tests/fsharpqa/Source/run_pl.fs b/tests/fsharpqa/Source/run_pl.fs new file mode 100644 index 00000000000..517c31516f7 --- /dev/null +++ b/tests/fsharpqa/Source/run_pl.fs @@ -0,0 +1,49 @@ +module RunPlTest + +open System +open System.IO +open NUnit.Framework + +open NUnitConf +open PlatformHelpers +open FSharpTestSuiteTypes + +let runplWithCmdsOverride cmdsOverride = attempt { + + let { Directory = dir; Config = cfg } = FSharpTestSuite.testContext () + let! vars = FSharpQATestSuite.envLstData () + + printfn "Directory: %s" dir + printfn "Test env var:" + vars |> List.iter (fun (k, v) -> printfn "%s=%s" k v) + + let allVars = + vars + |> List.append (cfg.EnvironmentVariables |> Map.toList) + |> List.append ["FSC_PIPE", cfg.FSC] + |> List.append ["FSI_PIPE", cfg.FSI] //that should be fsiAnyCpu + |> List.append ["FSI32_PIPE", cfg.FSI] + |> List.append ["CSC_PIPE", cfg.CSC] + |> List.append ["REDUCED_RUNTIME", "1"] //the peverify it's not implemented + |> Map.ofList + + //printfn "All env var:" + //allVars |> Map.iter (printfn "%s=%s") + + do! RunPl.runpl cmdsOverride dir allVars + + } + +let runplWithCmds cmds = + let cmdOverride c = cmds |> Map.tryFind c + runplWithCmdsOverride cmdOverride + +let runpl = runplWithCmdsOverride (fun _ -> None) + +let (|StartsWith|_|) (prefix: string) (input: string) = + match input.IndexOf(prefix) with + | i when i >= 0 -> + match i + prefix.Length with + | fromIndex when fromIndex <= input.Length -> Some (input.Substring(fromIndex)) + | _ -> None + | _ -> None diff --git a/tests/fsharpqa/Source/test_EnvLst.fs b/tests/fsharpqa/Source/test_EnvLst.fs index ef57fb159e9..a1a9a6ded67 100644 --- a/tests/fsharpqa/Source/test_EnvLst.fs +++ b/tests/fsharpqa/Source/test_EnvLst.fs @@ -1,4 +1,4 @@ -module ``FSharpQA-Tests-EnvLst`` +namespace FSharpQA.Tests open System open System.IO @@ -11,9 +11,11 @@ module ParseLine = let permutations () = [ TestCaseData("\tSOURCE=a", [ "SOURCE", "a" ]) TestCaseData("\tSOURCE=\"a file\"", [ "SOURCE", "a file" ]) - TestCaseData("\tSOURCE=\"a file with \\\"escaped values\\\" \"", [ "SOURCE", "a file with \\\"escaped values\\\" " ]) - TestCaseData("\tV1=parse V2=multiple V3=\"values works\"", [ "V1","parse"; "V2","multiple"; "V3","values works" ]) - ] + TestCaseData("\tSOURCE=\"a file with \\\"escaped values\\\" \"", [ "SOURCE", "a file with \"escaped values\" " ]) + TestCaseData("\tSOURCE=\"--subsystemversion:\\\"\\\" \"", [ "SOURCE", "--subsystemversion:\"\" " ]) + TestCaseData("\tSOURCE=\"--dir:a\\\\b\"", [ "SOURCE", "--dir:a\\b" ]) + TestCaseData("\tSOURCE=--dir:a\\\\b", [ "SOURCE", "--dir:a\\\\b" ]) + TestCaseData("\tV1=parse V2=multiple V3=\"values works\"", [ "V1","parse"; "V2","multiple"; "V3","values works" ]) ] [] let ``parse should split vars`` line expected = @@ -24,8 +26,3 @@ module ParseLine = let emptyData = { Tags = []; Vars = []; Comment = None } let expectedData = EnvLstLine.Data { emptyData with Vars = expected } Assert.IsTrue((l = expectedData), (sprintf "Expected '%A', but was '%A'" expected l)) - - - - - diff --git a/tests/fsharpqa/Source/test_Source.fs b/tests/fsharpqa/Source/test_Source.fs new file mode 100644 index 00000000000..b4803dfab64 --- /dev/null +++ b/tests/fsharpqa/Source/test_Source.fs @@ -0,0 +1,55 @@ +module ``FSharpQA-Tests`` + +open NUnit.Framework +open NUnitConf +open RunPlTest + +module Simple = + + [] + let Simple () = runpl |> check + +module EntryPoint = + + [] + let EntryPoint () = runpl |> check + +module Globalization = + + [] + let Globalization () = runpl |> check + +module Import = + + [] + let Import () = runpl |> check + +module Misc = + + [] + let Misc () = runpl |> check + +module MultiTargeting = + + [] + let MultiTargeting () = runpl |> check + +module OCamlCompat = + + [] + let OCamlCompat () = runpl |> check + +module Printing = + + [] + let Printing () = runpl |> check + +module Stress = + + [] + let Stress () = runpl |> check + +module Warnings = + + [] + let Warnings () = runpl |> check diff --git a/tests/fsharpqa/Source/test_run.fs b/tests/fsharpqa/Source/test_run.fs new file mode 100644 index 00000000000..1d1fad977c7 --- /dev/null +++ b/tests/fsharpqa/Source/test_run.fs @@ -0,0 +1,18 @@ +namespace FSharpQA.Tests + +open System +open System.IO +open NUnit.Framework + +module ParseXmlConfig = + + let permutations () = + [ TestCaseData(@"val e : seq", "val e : seq") + TestCaseData(@"The '<' operator should not normally be redefined\. To", "The '<' operator should not normally be redefined\. To") + TestCaseData(@"Missing 'do' in 'while' expression\. Expected 'while do '\.$", "Missing 'do' in 'while' expression\. Expected 'while do '\.$") ] + + [] + let ``parse should fix malformed xml`` line message = + match line |> RunPl.parseMalformedXml with + | Choice1Of2 xml -> Assert.AreEqual(message, xml.Value) + | Choice2Of2 exn -> Assert.Fail(sprintf "expected valid xml, but got error '%s'" exn.Message) diff --git a/tests/fsharpqa/Source/test_simple.fs b/tests/fsharpqa/Source/test_simple.fs deleted file mode 100644 index 9ea853f302e..00000000000 --- a/tests/fsharpqa/Source/test_simple.fs +++ /dev/null @@ -1,168 +0,0 @@ -module ``FSharp-Tests-Optimize`` - -open System -open System.IO -open NUnit.Framework - -open NUnitConf -open PlatformHelpers -open FSharpTestSuiteTypes - -let runpl = attempt { - - let { Directory = dir; Config = cfg } = FSharpTestSuite.testContext () - let! vars = FSharpQATestSuite.envLstData () - - printfn "Directory: %s" dir - printfn "%A" vars - - let allVars = - vars - |> List.append (cfg.EnvironmentVariables |> Map.toList) - |> List.append ["FSC_PIPE", cfg.FSC] - |> List.append ["FSI_PIPE", cfg.FSI] //that should be fsiAnyCpu - |> List.append ["FSI32_PIPE", cfg.FSI] - |> List.append ["CSC_PIPE", cfg.CSC] - |> List.append ["REDUCED_RUNTIME", "1"] //the peverify it's not implemented - |> Map.ofList - - do! RunPl.runpl dir allVars - - } - - -module Simple = - - [] - let ``Simple`` () = - runpl |> check - -module Libraries_Core_Collections = - - [] - let ``Libraries/Core/Collections`` () = - runpl |> check - - -module CompilerOptions_fsc_Removed = - - [] - let Removed () = - runpl |> check - -module CompilerOptions_fsc_checked = - - [] - let ``checked`` () = - runpl |> check - -module CompilerOptions_fsc_cliversion = - - [] - let cliversion () = - runpl |> check - -module CompilerOptions_fsc_codepage = - - [] - let codepage () = - runpl |> check - -module CompilerOptions_fsc_crossoptimize = - - [] - let crossoptimize () = - runpl |> check - - -module CompilerOptions_fsc_debug = - - [] - let debug () = - runpl |> check - -module CompilerOptions_fsc_dumpAllCommandLineOptions = - - [] - let dumpAllCommandLineOptions () = - runpl |> check - -module CompilerOptions_fsc_flaterrors = - - [] - let flaterrors () = - runpl |> check - -module CompilerOptions_fsc_gccerrors = - - [] - let gccerrors () = - runpl |> check - -module CompilerOptions_fsc_help = - - [] - let help () = - runpl |> check - -module CompilerOptions_fsc_highentropyva = - - [] - let highentropyva () = - runpl |> check - -module CompilerOptions_fsc_invalid = - - [] - let invalid () = - runpl |> check - -module CompilerOptions_fsc_lib = - - [] - let lib () = - runpl |> check - -module CompilerOptions_fsc_noframework = - - [] - let noframework () = - runpl |> check - -module CompilerOptions_fsc_nologo = - - [] - let nologo () = - runpl |> check - -//optimize - - -module CompilerOptions_fsc_out = - - [] - let ``CompilerOptions/fsc/out`` () = - runpl |> check - -//pdb -//platform -//reference -//simpleresolution -//standalone -//staticlink -//subsystemversion -//tailcalls -//target -//times -//warn -//warnaserror - -module CompilerOptions_fsc_warnon = - - [] - let ``CompilerOptions/fsc/warnon`` () = - runpl |> check - -//win32res - -