Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5649e7

Browse files
committed
Add IDE unit tests
1 parent1dc3e15 commitf5649e7

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

‎vsintegration/src/unittests/Tests.LanguageService.Script.fs‎

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,81 @@ type ScriptTests() as this =
593593
letcode=["#light";"#r @\""+ fullyqualifiepathtoddll+"\""]
594594
let(project,_)= createSingleFileFsxFromLines code
595595
AssertNoErrorsOrWarnings(project)
596-
596+
597+
[<Test>]
598+
[<Category("fsx closure")>]
599+
memberpublicthis.``Fsx.NoError.HashR.RelativePath1``()=
600+
use _guard= this.UsingNewVS()
601+
letsolution= this.CreateSolution()
602+
letproject= CreateProject(solution,"testproject")
603+
letfile1= AddFileFromText(project,"lib.fs",
604+
["module Lib"
605+
"let X = 42"
606+
])
607+
608+
letbld= Build(project)
609+
610+
letscript1Dir= Path.Combine(ProjectDirectory(project),"ccc")
611+
letscript1Path= Path.Combine(script1Dir,"Script1.fsx")
612+
letscript2Dir= Path.Combine(ProjectDirectory(project),"aaa\\bbb")
613+
letscript2Path= Path.Combine(script2Dir,"Script2.fsx")
614+
615+
Directory.CreateDirectory(script1Dir)|> ignore
616+
Directory.CreateDirectory(script2Dir)|> ignore
617+
File.Move(bld.ExecutableOutput, Path.Combine(ProjectDirectory(project),"aaa\\lib.exe"))
618+
619+
letscript1= File.WriteAllLines(script1Path,
620+
["#load\"../aaa/bbb/Script2.fsx\""
621+
"printfn\"%O\" Lib.X"
622+
])
623+
letscript2= File.WriteAllLines(script2Path,
624+
["#r\"../lib.exe\""
625+
])
626+
627+
letscript1= OpenFile(project, script1Path)
628+
TakeCoffeeBreak(this.VS)
629+
630+
MoveCursorToEndOfMarker(script1,"#load")
631+
letans= GetSquiggleAtCursor(script1)
632+
AssertNoSquiggle(ans)
633+
634+
[<Test>]
635+
[<Category("fsx closure")>]
636+
memberpublicthis.``Fsx.NoError.HashR.RelativePath2``()=
637+
use _guard= this.UsingNewVS()
638+
letsolution= this.CreateSolution()
639+
letproject= CreateProject(solution,"testproject")
640+
letfile1= AddFileFromText(project,"lib.fs",
641+
["module Lib"
642+
"let X = 42"
643+
])
644+
645+
letbld= Build(project)
646+
647+
letscript1Dir= Path.Combine(ProjectDirectory(project),"ccc")
648+
letscript1Path= Path.Combine(script1Dir,"Script1.fsx")
649+
letscript2Dir= Path.Combine(ProjectDirectory(project),"aaa")
650+
letscript2Path= Path.Combine(script2Dir,"Script2.fsx")
651+
652+
Directory.CreateDirectory(script1Dir)|> ignore
653+
Directory.CreateDirectory(script2Dir)|> ignore
654+
File.Move(bld.ExecutableOutput, Path.Combine(ProjectDirectory(project),"aaa\\lib.exe"))
655+
656+
letscript1= File.WriteAllLines(script1Path,
657+
["#load\"../aaa/Script2.fsx\""
658+
"printfn\"%O\" Lib.X"
659+
])
660+
letscript2= File.WriteAllLines(script2Path,
661+
["#r\"lib.exe\""
662+
])
663+
664+
letscript1= OpenFile(project, script1Path)
665+
TakeCoffeeBreak(this.VS)
666+
667+
MoveCursorToEndOfMarker(script1,"#load")
668+
letans= GetSquiggleAtCursor(script1)
669+
AssertNoSquiggle(ans)
670+
597671
/// FEATURE: #load in an .fsx file will include that file in the 'build' of the .fsx.
598672
[<Test>]
599673
memberpublicthis.``Fsx.NoError.HashLoad.Simple``()=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp