From b15f804a6f24a12d3dd5d4b2900e70eb57cddc9e Mon Sep 17 00:00:00 2001
From: "Thorsten (Gerbrunn)"
Date: Thu, 25 Jun 2020 20:17:39 +0200
Subject: [PATCH 01/12] Migrated AbsOnIntegers01.fs test case
---
.../Libraries/Core/Operators/AbsTests.fs | 21 +++++++++++++++++++
tests/fsharp/FSharpSuite.Tests.fsproj | 1 +
.../Core/Operators/AbsOnIntegers01.fs | 15 -------------
.../Source/Libraries/Core/Operators/env.lst | 3 +--
4 files changed, 23 insertions(+), 17 deletions(-)
create mode 100644 tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs
delete mode 100644 tests/fsharpqa/Source/Libraries/Core/Operators/AbsOnIntegers01.fs
diff --git a/tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs b/tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs
new file mode 100644
index 00000000000..26d1af738fa
--- /dev/null
+++ b/tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
+
+namespace FSharp.Compiler.UnitTests
+
+open NUnit.Framework
+open FSharp.Test.Utilities
+open FSharp.Compiler.SourceCodeServices
+
+[]
+module ``Abs Tests`` =
+
+ []
+ let ``Abs of integral types``() =
+ // Regression test for FSHARP1.0:3470 - exception on abs of native integer
+
+ Assert.areEqual (abs -1y) 1y // signed byte
+ Assert.areEqual (abs -1s) 1s // int16
+ Assert.areEqual (abs -1l) 1l // int32
+ Assert.areEqual (abs -1n) 1n // nativeint
+ Assert.areEqual (abs -1L) 1L // int64
+ Assert.areEqual (abs -1I) 1I // bigint
\ No newline at end of file
diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj
index 374a27b68cb..776ba3944f2 100644
--- a/tests/fsharp/FSharpSuite.Tests.fsproj
+++ b/tests/fsharp/FSharpSuite.Tests.fsproj
@@ -68,6 +68,7 @@
+
diff --git a/tests/fsharpqa/Source/Libraries/Core/Operators/AbsOnIntegers01.fs b/tests/fsharpqa/Source/Libraries/Core/Operators/AbsOnIntegers01.fs
deleted file mode 100644
index 76687657876..00000000000
--- a/tests/fsharpqa/Source/Libraries/Core/Operators/AbsOnIntegers01.fs
+++ /dev/null
@@ -1,15 +0,0 @@
-// #Regression #Libraries #Operators
-// Regression test for FSHARP1.0:3470 - exception on abs of native integer
-
-#light
-
-let res =
- abs -1y = 1y // signed byte
- && abs -1s = 1s // int16
- && abs -1l = 1l // int32
- && abs -1n = 1n // nativeint
- && abs -1L = 1L // int64
- && abs -1I = 1I // bigint
-
-if not res then exit 1
-exit 0
diff --git a/tests/fsharpqa/Source/Libraries/Core/Operators/env.lst b/tests/fsharpqa/Source/Libraries/Core/Operators/env.lst
index 3b893973508..b2825f967b6 100644
--- a/tests/fsharpqa/Source/Libraries/Core/Operators/env.lst
+++ b/tests/fsharpqa/Source/Libraries/Core/Operators/env.lst
@@ -3,11 +3,10 @@
SOURCE=E_sign02.fs SCFLAGS=--test:ErrorRanges # E_sign02.fs
SOURCE=round01.fs # round01.fs
SOURCE=string01.fs # string01.fs
- SOURCE=AbsOnIntegers01.fs # AbsOnIntegers01.fs
SOURCE=E_AbsOnIntegers02.fs SCFLAGS="--test:ErrorRanges --nowarn:20" # E_AbsOnIntegers02.fs
SOURCE=CastOperator.fs # CastOperator.fs
SOURCE=EqualityAndUncheckedHash01.fs SCFLAGS=-a # EqualityAndUncheckedHash01.fs
SOURCE=E_EqualityAndHash01.fs SCFLAGS=--test:ErrorRanges # E_EqualityAndHash01.fs
-
+
SOURCE=StringOnEnum01.fs # StringOnEnum01.fs
\ No newline at end of file
From 056896c988920282f966fc11e0a4f359f1dca9b0 Mon Sep 17 00:00:00 2001
From: "Thorsten (Gerbrunn)"
Date: Thu, 25 Jun 2020 20:22:56 +0200
Subject: [PATCH 02/12] Cleanup
---
tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs b/tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs
index 26d1af738fa..1d35f72127e 100644
--- a/tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs
+++ b/tests/fsharp/Compiler/Libraries/Core/Operators/AbsTests.fs
@@ -4,7 +4,6 @@ namespace FSharp.Compiler.UnitTests
open NUnit.Framework
open FSharp.Test.Utilities
-open FSharp.Compiler.SourceCodeServices
[]
module ``Abs Tests`` =
From 0bae86416d9ff81d05bd48a22df7199aa92b25d7 Mon Sep 17 00:00:00 2001
From: "Thorsten (Gerbrunn)"
Date: Thu, 25 Jun 2020 20:23:11 +0200
Subject: [PATCH 03/12] Migrated CastOperator.fs test case
---
.../Libraries/Core/Operators/CastTests.fs | 19 +++++++++++++++++++
tests/fsharp/FSharpSuite.Tests.fsproj | 1 +
.../Libraries/Core/Operators/CastOperator.fs | 11 -----------
.../Source/Libraries/Core/Operators/env.lst | 1 -
4 files changed, 20 insertions(+), 12 deletions(-)
create mode 100644 tests/fsharp/Compiler/Libraries/Core/Operators/CastTests.fs
delete mode 100644 tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs
diff --git a/tests/fsharp/Compiler/Libraries/Core/Operators/CastTests.fs b/tests/fsharp/Compiler/Libraries/Core/Operators/CastTests.fs
new file mode 100644
index 00000000000..5f4d34df153
--- /dev/null
+++ b/tests/fsharp/Compiler/Libraries/Core/Operators/CastTests.fs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
+
+namespace FSharp.Compiler.UnitTests
+
+open NUnit.Framework
+open FSharp.Test.Utilities
+open System
+
+[]
+module ``Cast Tests`` =
+
+ []
+ let ``Cast precedence over expression forms``() =
+ // Regression test for FSHARP1.0:1247
+ // Precedence of type annotations :> and :?> over preceeding expression forms, e.g. if-then-else etc.
+
+ Assert.IsInstanceOf