Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo for bug that affects FAKE #453

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions tests/service/BugRepos.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#if INTERACTIVE
#r "../../bin/v4.5/FSharp.Compiler.Service.dll"
#r "../../packages/NUnit/lib/nunit.framework.dll"
#load "FsUnit.fs"
#load "Common.fs"
#else
module FSharp.Compiler.Service.Tests.RugRepos
#endif


open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.Interactive.Shell
open Microsoft.FSharp.Compiler.SourceCodeServices

open NUnit.Framework
open FsUnit
open System
open System.IO
open System.Text

// Intialize output and input streams
let inStream = new StringReader("")
let outStream = new CompilerOutputStream()
let errStream = new CompilerOutputStream()

// Build command line arguments & start FSI session
let argv = [| "C:\\fsi.exe" |]
let allArgs = Array.append argv [|"--noninteractive"|]

let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration(fsi)
let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, new StreamWriter(outStream), new StreamWriter(errStream))

/// Evaluate interaction & ignore the result
let evalInteraction text =
fsiSession.EvalInteraction(text)

[<Test>]
let ``FAKE #985 - works``() =
let script = "

let configure () =
let dlls = seq { yield \"\" }
let tabName = \"\" //new System.String([||]) // sprintf \"%s\" \"\"
for _ in dlls do
System.Console.WriteLine(tabName)"
evalInteraction script

[<Test>]
let ``FAKE #985 - fails``() =
let script = "

let configure () =
let dlls = seq { yield \"\" }
let tabName = new System.String([||])
for _ in dlls do
System.Console.WriteLine(tabName)"
evalInteraction script

1 change: 1 addition & 0 deletions tests/service/FSharp.Compiler.Service.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<Compile Include="InteractiveCheckerTests.fs" />
<Compile Include="ExprTests.fs" />
<Compile Include="CSharpProjectAnalysis.fs" />
<Compile Include="BugRepos.fs" />
<None Include="paket.references" />
<None Include="app.config" />
</ItemGroup>
Expand Down