Skip to content

Commit

Permalink
Moved CodeGen/EmittedIL/LiteralValue over to NUnit (#7291)
Browse files Browse the repository at this point in the history
* Moved CodeGen/EmittedIL/LiteralValue over to NUnit

* Expected IL simplified to test one thing and to be runtime independent
  • Loading branch information
sergey-tihon authored and KevinRansom committed Aug 2, 2019
1 parent 29bf51a commit 31388f7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 88 deletions.
28 changes: 28 additions & 0 deletions tests/fsharp/Compiler/CodeGen/EmittedIL/LiteralValue.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL

open FSharp.Compiler.UnitTests
open NUnit.Framework

[<TestFixture>]
module ``Literal Value`` =

[<Test>]
let ``Literal Value``() =
CompilerAssert.CompileLibraryAndVerifyIL
"""
module LiteralValue
[<Literal>]
let x = 7
[<EntryPoint>]
let main _ =
0
"""
(fun verifier -> verifier.VerifyIL [
"""
.field public static literal int32 x = int32(0x00000007)
"""
])
1 change: 1 addition & 0 deletions tests/fsharp/Compiler/ILChecker.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module ILChecker =
|> filterSpecialComment

expectedIL
|> List.map (fun (ilCode: string) -> ilCode.Trim() )
|> List.iter (fun (ilCode: string) ->
let expectedLines = ilCode.Split('\n')
let startIndex = textNoComments.IndexOf(expectedLines.[0])
Expand Down
1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<Compile Include="Compiler\ILChecker.fs" />
<Compile Include="Compiler\Utilities.fs" />
<Compile Include="Compiler\CompilerAssert.fs" />
<Compile Include="Compiler\CodeGen\EmittedIL\LiteralValue.fs" />
<Compile Include="Compiler\Conformance\BasicGrammarElements\BasicConstants.fs" />
<Compile Include="Compiler\ErrorMessages\ConstructorTests.fs" />
<Compile Include="Compiler\ErrorMessages\ClassesTests.fs" />
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 31388f7

Please sign in to comment.