From acde7aa6d04a61bf51f7dc577fd5954f507dac61 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:31:03 +0200 Subject: [PATCH 1/2] fix quotes test, update readme --- tests/fsharp/FSharpSuite.Tests.fsproj | 6 +++++- .../fsharp/{NUnitHelpers.fs => XunitHelpers.fs} | 0 tests/fsharp/core/quotes/cslib.dll | Bin 0 -> 3584 bytes tests/fsharp/readme.md | 12 ++++++------ tests/fsharp/xunit.runner.json | 5 +++++ 5 files changed, 16 insertions(+), 7 deletions(-) rename tests/fsharp/{NUnitHelpers.fs => XunitHelpers.fs} (100%) create mode 100644 tests/fsharp/core/quotes/cslib.dll create mode 100644 tests/fsharp/xunit.runner.json diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 7b33353283b..83c840652b5 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -20,7 +20,7 @@ scriptlib.fsx - + @@ -100,6 +100,10 @@ + + + + diff --git a/tests/fsharp/NUnitHelpers.fs b/tests/fsharp/XunitHelpers.fs similarity index 100% rename from tests/fsharp/NUnitHelpers.fs rename to tests/fsharp/XunitHelpers.fs diff --git a/tests/fsharp/core/quotes/cslib.dll b/tests/fsharp/core/quotes/cslib.dll new file mode 100644 index 0000000000000000000000000000000000000000..79b530ded94af7b960632ed7be1b144807ee15d7 GIT binary patch literal 3584 zcmeHJOK%%h6#m9`QYTGAT13@~N2hs|k|N6`K>`#NCvjQ=O;chg15|r=U89&mN*QP?ECz*54IrqEg ze&^mhcf9b*B_si)_}sh+TxBbg)B3N~Cc6jseKUwFeb@G1HI84~UtG5Xv+jFU->R8q z%XPibEGg4(xTfuz`Ne`+^C~K{V@LmJociP(aNJ1Z?UC=-TC-ipu({pH0=LB$DqiS89AFad4Y-fC1)Djgw5_ z`57agNvNKg%w#hY*@?qX%X~d>s6XT2k@GBt^?WFHA@psx8VKTJ9$Zvs|)0S-> zIkr5XXZr>HOXANsUWu&;Qy8Zn0Q$uF)tJEUs7{jNY*8)_(~QVf<76G=0e+6#UVMcy zqZi+4eG$8i`!GjHFIIHq27aUch9UY*Z9k*+IYvaH&C_)oL&&3O>}6&qp!X>=h?hVg zy`4ml(M~clBnUi4JBb5G8T*+1g4R!9n2}-roiqu-`+Ek+&cMrUPqN!>Z%k)0@Sf3! z0mI-dg5OKs&-`LfQxD;=wqMlxQS8D8$Y49hsqe=G^@CW#EJpAubw71k+vV6kgjJ+A zaf>`eUv{h|yO}GNS;q>3!+K>@X(?D>veLOBp!Yc46P;<--qsI8m|{it2B zoQ5hk>k4zVlB!fxWjf>;DK$ccS+7>N9pxWWuJWz0yQ>Xa4y>wbd&sL&qgu5}PFHM6 ztre^_6*iYhE$CpQ^j2tl?viq>4Q+MxFE!lIt|@`Bt7JQN*zAnfWo0UkgF-V1RShf3 z510y>a_ISSFq5~fs_O-zT@G5IIBlj?T|xP0?6L}C?tDGCh;$e1vhM}nT1aF?O}m!U z4D0}H21U!SsxZJ}>2*~OaRwXFUM%l>;ob9xZY+E>G@IUY^w8%>nTC;0nlO53?A)pK z!|AWzdTnLzG#$R+ZrqFv#}$$MORuK%~Ko9YQbk7 zo8Jk=oG#Yj>HblD#}wIXF&ePnLP(rPFOn})pYY%rNO>u735RjiW}^eZx@b1%kmsakTkR#3b@pJP(jagt*_ z&f6f5kUOxonob>36MskOG1Fum5LqKf] + [] let ``array-FSI`` () = singleTestBuildAndRun "core/array" FSI ```` This test case builds and runs the test case in the folder core/array @@ -20,7 +20,7 @@ __#if !NETCOREAPP__ There are some older tests in this section that looks similar to: ```` - [] + [] let events () = let cfg = testConfig "core/events" fsc cfg "%s -a -o:test.dll -g" cfg.fsc_flags ["test.fs"] @@ -34,11 +34,11 @@ There are some older tests in this section that looks similar to: ```` These tests build, compile, peverify and run fsi. -Below the Compiler directory there is a set of tests built on the compiler service. They are nunit and instead of executing the compiler and fsi using files on disk the tests are built from memory. These tests use the CompilerAssert framework and look similar to: +Below the Compiler directory there is a set of tests built on the compiler service. They are xUnit and instead of executing the compiler and fsi using files on disk the tests are built from memory. These tests use the CompilerAssert framework and look similar to: This test verifies that a warning is produces when a value is implicitly discarded. The line ````x = 20``` looks like an assignment but in F# is a test for equality it yields and discards the value false. ```` - [] + [] let ``Unused compare with immutable when assignment might be intended``() = CompilerAssert.TypeCheckSingleError """ @@ -62,4 +62,4 @@ When a test is run, .err/.vserr output files are created and compared to their m Refer to [Test Guide](../../TESTGUIDE.md#baselines) to know more about how to update them. -Tests are organized under modules as functions bearing NUnit `[]` attribute and can be run from an IDE or the command line (see the [Test Guide](../../TESTGUIDE.md)). +Tests are organized under modules as functions bearing xUnit `[]` attribute and can be run from an IDE or the command line (see the [Test Guide](../../TESTGUIDE.md)). diff --git a/tests/fsharp/xunit.runner.json b/tests/fsharp/xunit.runner.json new file mode 100644 index 00000000000..4e5a48343ec --- /dev/null +++ b/tests/fsharp/xunit.runner.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "appDomain": "ifAvailable", + "shadowCopy": false +} \ No newline at end of file From eaf5bdce2f3747130c6d811e2f8be5b8149e11bc Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 3 Sep 2024 18:01:53 +0200 Subject: [PATCH 2/2] Update SpanTests.fs --- tests/fsharp/Compiler/Language/SpanTests.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharp/Compiler/Language/SpanTests.fs b/tests/fsharp/Compiler/Language/SpanTests.fs index bd89f0fcbfe..5e4d39af8dd 100644 --- a/tests/fsharp/Compiler/Language/SpanTests.fs +++ b/tests/fsharp/Compiler/Language/SpanTests.fs @@ -176,7 +176,7 @@ type T(span: Span) = struct end """ [| |] - [] + [] let ``A byref struct with custom attr can be passed as typar``() = CompilerAssert.TypeCheckWithErrors """ namespace System.Runtime.CompilerServices @@ -193,4 +193,4 @@ module WhatEver = let processT (a: Action, ie: seq, asList: list) = () """ [| FSharpDiagnosticSeverity.Error, 3300, (13, 45, 13, 51), "The parameter 'asList' has an invalid type 'T list'. This is not permitted by the rules of Common IL." |] -#endif \ No newline at end of file +#endif