Skip to content

Commit

Permalink
Improve directory attribute refactor - Break up PR #18161 - Part 2 (#…
Browse files Browse the repository at this point in the history
…18196)

* More tests - directory attribute improvements

* methordresolution
  • Loading branch information
KevinRansom authored Jan 8, 2025
1 parent 73b8cbb commit a310d1d
Show file tree
Hide file tree
Showing 54 changed files with 2,350 additions and 1,727 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,71 +9,79 @@ open Xunit
module Checked =

// SOURCE=unchecked01.fs # fsc-default
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unchecked01.fs"|])>]
let ``fsc-unchecked - unchecked01_fs`` compilation =
compilation
[<Theory; FileInlineData("unchecked01.fs")>]
let ``fsc-unchecked - unchecked01_fs`` compilation =
compilation
|> getCompilation
|> asFs
|> compile
|> shouldSucceed

// SOURCE=checked01.fs SCFLAGS="--checked" # fsc-checked
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unchecked01.fs"|])>]
let ``fsc-unchecked - unchecked01_fs --checked`` compilation =
compilation
[<Theory; FileInlineData("unchecked01.fs")>]
let ``fsc-unchecked - unchecked01_fs --checked`` compilation =
compilation
|> getCompilation
|> asFs
|> withOptions["--checked"]
|> compile
|> shouldSucceed

// SOURCE=checked01.fs SCFLAGS="--checked+" # fsc-checked+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unchecked01.fs"|])>]
let ``fsc-unchecked - unchecked01_fs --checked+`` compilation =
compilation
[<Theory; FileInlineData("unchecked01.fs")>]
let ``fsc-unchecked - unchecked01_fs --checked+`` compilation =
compilation
|> getCompilation
|> asFs
|> withOptions["--checked+"]
|> compile
|> shouldSucceed

// SOURCE=unchecked01.fs SCFLAGS="--checked-" # fsc-checked-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unchecked01.fs"|])>]
let ``fsc-unchecked - unchecked01_fs --checked-`` compilation =
compilation
[<Theory; FileInlineData("unchecked01.fs")>]
let ``fsc-unchecked - unchecked01_fs --checked-`` compilation =
compilation
|> getCompilation
|> asFs
|> withOptions["--checked-"]
|> compile
|> shouldSucceed

// SOURCE=unchecked01.fs SCFLAGS="--checked-" # fsc-checked-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unchecked01.fs"|])>]
let ``fsi-unchecked - unchecked01_fs --checked-`` compilation =
compilation
[<Theory; FileInlineData("unchecked01.fs")>]
let ``fsi-unchecked - unchecked01_fs --checked-`` compilation =
compilation
|> getCompilation
|> asFsx
|> withOptions["--checked-"]
|> compile
|> shouldSucceed

// SOURCE=checked01.fs SCFLAGS="--checked" FSIMODE=EXEC COMPILE_ONLY=1 # fsi-checked
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"checked01.fs"|])>]
let ``fsi-checked - checked01_fs --checked`` compilation =
compilation
[<Theory; FileInlineData("checked01.fs")>]
let ``fsi-checked - checked01_fs --checked`` compilation =
compilation
|> getCompilation
|> asFsx
|> withOptions["--checked"]
|> compile
|> shouldSucceed

// SOURCE=checked01.fs SCFLAGS="--checked+" FSIMODE=EXEC COMPILE_ONLY=1 # fsi-checked+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"checked01.fs"|])>]
let ``fsi-checked - checked01_fs --checked+`` compilation =
compilation
[<Theory; FileInlineData("checked01.fs")>]
let ``fsi-checked - checked01_fs --checked+`` compilation =
compilation
|> getCompilation
|> asFsx
|> withOptions["--checked+"]
|> compile
|> shouldSucceed

// SOURCE=checked01.fs SCFLAGS="--checked-" FSIMODE=EXEC COMPILE_ONLY=1 # fsi-checked+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"checked01.fs"|])>]
let ``fsi-checked - checked01_fs --checked-`` compilation =
compilation
[<Theory; FileInlineData("checked01.fs")>]
let ``fsi-checked - checked01_fs --checked-`` compilation =
compilation
|> getCompilation
|> asFsx
|> withOptions["--checked-"]
|> compile
Expand All @@ -83,64 +91,71 @@ module Checked =
//# Last one wins

// SOURCE=checked01.fs SCFLAGS="--checked --checked+" # fsc-checkedchecked+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"checked01.fs"|])>]
let ``fsc-checked - checked01_fs --checked --checked+`` compilation =
compilation
[<Theory; FileInlineData("checked01.fs")>]
let ``fsc-checked - checked01_fs --checked --checked+`` compilation =
compilation
|> getCompilation
|> asFs
|> withOptions["--checked"; "--checked+"]
|> compile
|> shouldSucceed

// SOURCE=checked01.fs SCFLAGS="--checked- --checked+" # fsc-checked-checked+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"checked01.fs"|])>]
let ``fsc-checked - checked01_fs --checked- --checked+`` compilation =
compilation
[<Theory; FileInlineData("checked01.fs")>]
let ``fsc-checked - checked01_fs --checked- --checked+`` compilation =
compilation
|> getCompilation
|> asFs
|> withOptions["--checked-"; "--checked+"]
|> compile
|> shouldSucceed

// SOURCE=unchecked01.fs SCFLAGS="--checked+ --checked-" # fsc-checked+checked-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unchecked01.fs"|])>]
let ``fsc-checked - unchecked01_fs --checked+ --checked-`` compilation =
compilation
[<Theory; FileInlineData("unchecked01.fs")>]
let ``fsc-checked - unchecked01_fs --checked+ --checked-`` compilation =
compilation
|> getCompilation
|> asFs
|> withOptions["--checked+"; "--checked-"]
|> compile
|> shouldSucceed

// SOURCE=checked01.fs SCFLAGS="--checked --checked+" # fsc-checkedchecked+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"checked01.fs"|])>]
let ``fsi-checked - checked01_fs --checked --checked+`` compilation =
compilation
[<Theory; FileInlineData("checked01.fs")>]
let ``fsi-checked - checked01_fs --checked --checked+`` compilation =
compilation
|> getCompilation
|> asFsx
|> withOptions["--checked"; "--checked+"]
|> compile
|> shouldSucceed

// SOURCE=checked01.fs SCFLAGS="--checked- --checked+" # fsc-checked-checked+
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"checked01.fs"|])>]
let ``fsi-checked - checked01_fs --checked- --checked+`` compilation =
compilation
[<Theory; FileInlineData("checked01.fs")>]
let ``fsi-checked - checked01_fs --checked- --checked+`` compilation =
compilation
|> getCompilation
|> asFsx
|> withOptions["--checked-"; "--checked+"]
|> compile
|> shouldSucceed

// SOURCE=unchecked01.fs SCFLAGS="--checked+ --checked-" # fsc-checked+checked-
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unchecked01.fs"|])>]
let ``fsi-checked - unchecked01_fs --checked+ --checked-`` compilation =
compilation
[<Theory; FileInlineData("unchecked01.fs")>]
let ``fsi-checked - unchecked01_fs --checked+ --checked-`` compilation =
compilation
|> getCompilation
|> asFsx
|> withOptions["--checked+"; "--checked-"]
|> compile
|> shouldSucceed

//# Unrecognized argument
// SOURCE=unrecogarg.fs SCFLAGS="--Checked" # fsc--Checked
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unrecogarg.fs"|])>]
let ``fsc-checked - unchecked01_fs Checked`` compilation =
compilation
[<Theory; FileInlineData("unrecogarg.fs")>]
let ``fsc-checked - unchecked01_fs Checked`` compilation =
compilation
|> getCompilation
|> asFs
|> withOptions["--Checked"]
|> compile
Expand All @@ -150,9 +165,10 @@ module Checked =
]

// SOURCE=unrecogarg.fs SCFLAGS="--checked*" # fsc--checked*
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"unrecogarg.fs"|])>]
let ``fsc-checked - unchecked01_fs --checked-star`` compilation =
compilation
[<Theory; FileInlineData("unrecogarg.fs")>]
let ``fsc-checked - unchecked01_fs --checked-star`` compilation =
compilation
|> getCompilation
|> asFs
|> withOptions["--checked*"]
|> compile
Expand All @@ -162,9 +178,10 @@ module Checked =
]

// SOURCE=unrecogarg.fs SCFLAGS="--checked*" # fsc--checked*
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"UncheckedDefaultOf01.fs"|])>]
let ``fsc-checked - UncheckedDefaultOf01`` compilation =
compilation
[<Theory; FileInlineData( "UncheckedDefaultOf01.fs")>]
let ``fsc-checked - UncheckedDefaultOf01`` compilation =
compilation
|> getCompilation
|> asFs
|> asExe
|> compile
Expand Down
Loading

0 comments on commit a310d1d

Please sign in to comment.