Skip to content

Commit a233c0a

Browse files
mstyuralatkin
authored andcommitted
Added tests to reveal problem with source code location for FS0988 warning
closes dotnet/fsharp#465 ref dotnet/fsharp#461 commit c129badb23e20de07bdb38ea16fa2fa32a31cdb1 Author: Yury Yaroshevich <mstyura@hotmail.com> Date: Thu May 21 22:34:51 2015 +0300 dotnet/fsharp#461: Added tests to reveal problem with source code location for FS0988 warning
1 parent 88e246b commit a233c0a

File tree

5 files changed

+61
-1
lines changed

5 files changed

+61
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// #Regression #NoMT #EntryPoint
2+
// Empty program entry point warning
3+
// Lack of entry point produces warning with correct source location when compiled to *.exe
4+
// when multiple namespaces with multiple modules declared in source file
5+
//<Expects id="FS0988" span="(22,24-22,24)" status="warning">Main module of program is empty\: nothing will happen when it is run</Expects>
6+
7+
#light
8+
namespace MyNamespace1
9+
10+
module MyModule1 =
11+
let irrelevant = 10
12+
13+
module MyModule2 =
14+
let irrelevant = 10
15+
16+
namespace MyNamespace2
17+
18+
module MyModule3 =
19+
let irrelevant = 10
20+
21+
module MyModule4 =
22+
let irrelevant = 10
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// #Regression #NoMT #EntryPoint
2+
// Empty program entry point warning
3+
// Lack of entry point produces warning with correct source location when compiled to *.exe
4+
// when single module declared inside namespace
5+
//<Expects id="FS0988" span="(11,24-11,24)" status="warning">Main module of program is empty\: nothing will happen when it is run</Expects>
6+
7+
#light
8+
namespace MyNamespace1
9+
10+
module MyModule1 =
11+
let irrelevant = 10
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// #Regression #NoMT #EntryPoint
2+
// Empty program entry point warning
3+
// Lack of entry point produces warning with correct source location when compiled to *.exe
4+
// when multiple modules declared without declaring namespace
5+
//<Expects id="FS0988" span="(13,24-13,24)" status="warning">Main module of program is empty\: nothing will happen when it is run</Expects>
6+
7+
#light
8+
9+
module MyModule1 =
10+
let irrelevant = 10
11+
12+
module MyModule2 =
13+
let irrelevant = 10
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// #Regression #NoMT #EntryPoint
2+
// Empty program entry point warning
3+
// Lack of entry point produces warning with correct source location when compiled to *.exe
4+
// when source file declares type inside namespace
5+
//<Expects id="FS0988" span="(10,18-10,18)" status="warning">Main module of program is empty\: nothing will happen when it is run</Expects>
6+
7+
#light
8+
namespace MyNamespace1
9+
10+
type T = T of int

tests/fsharpqa/Source/EntryPoint/env.lst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ NoMT SOURCE=entrypointandFSI02.fsx FSIMODE=EXEC COMPILE_ONLY=1 # entrypointan
1616

1717
SOURCE=E_CompilingToALibrary01.fs SCFLAGS="--test:ErrorRanges --target:library" # E_CompilingToALibrary01.fs
1818
SOURCE=E_CompilingToAModule01.fs SCFLAGS="--test:ErrorRanges --target:module" # E_CompilingToAModule01.fs
19-
SOURCE=EntryPointAndAssemblyCulture.fs # EntryPointAndAssemblyCulture.fs
19+
SOURCE=EntryPointAndAssemblyCulture.fs # EntryPointAndAssemblyCulture.fs
20+
SOURCE=W_NoEntryPointInLastModuleInsideMultipleNamespace.fs SCFLAGS="--test:ErrorRanges" # W_NoEntryPointInLastModuleInsideMultipleNamespace.fs
21+
SOURCE=W_NoEntryPointModuleInNamespace.fs SCFLAGS="--test:ErrorRanges" # W_NoEntryPointModuleInNamespace.fs
22+
SOURCE=W_NoEntryPointMultipleModules.fs SCFLAGS="--test:ErrorRanges" # W_NoEntryPointMultipleModules.fs
23+
SOURCE=W_NoEntryPointTypeInNamespace.fs SCFLAGS="--test:ErrorRanges" # W_NoEntryPointTypeInNamespace.fs

0 commit comments

Comments
 (0)