Skip to content

Commit

Permalink
FileConventions.Test: add failing test
Browse files Browse the repository at this point in the history
Add failing test for
DetectInconsistentVersionsInNugetRefsInFSharpScripts function.
  • Loading branch information
tehraninasab committed Jun 26, 2023
1 parent 1b16594 commit 4444c8a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env -S dotnet fsi

open System
open System.IO

#r "nuget: Fsdk, Version=0.6.0"

printfn "Hello World!"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env -S dotnet fsi

open System
open System.IO

#r "nuget: Fsdk, Version=0.6.1"

printfn "Hello World!"
27 changes: 27 additions & 0 deletions src/FileConventions.Test/FileConventions.Test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -493,3 +493,30 @@ let DetectInconsistentVersionsInGitHubCI1() =
)

Assert.That(DetectInconsistentVersionsInGitHubCI fileInfo, Is.EqualTo true)


[<Test>]
let DetectInconsistentVersionsInNugetRefsInFSharpScripts1() =
let fileInfos =
(seq {

FileInfo(
Path.Combine(
dummyFilesDirectory.FullName,
"DummyFsharpScriptWithFsdkVersion0.6.0.fsx"
)
)

FileInfo(
Path.Combine(
dummyFilesDirectory.FullName,
"DummyFsharpScriptWithFsdkVersion0.6.1.fsx"
)
)

})

Assert.That(
DetectInconsistentVersionsInNugetRefsInFSharpScripts fileInfos,
Is.EqualTo true
)
8 changes: 8 additions & 0 deletions src/FileConventions/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,11 @@ let DetectInconsistentVersionsInGitHubCI(dir: DirectoryInfo) =
false
else
DetectInconsistentVersionsInGitHubCIWorkflow ymlFiles

let DetectInconsistentVersionsInNugetRefsInFSharpScripts
(fileInfos: seq<FileInfo>)
=
fileInfos
|> Seq.iter(fun fileInfo -> assert (fileInfo.FullName.EndsWith ".fsx"))

false

0 comments on commit 4444c8a

Please sign in to comment.