@@ -135,7 +135,7 @@ module ExpectNotification =
135135
136136 member __.Notifications
137137 with get () = notifications |> List.ofSeq
138-
138+
139139let findByPath path parsed =
140140 parsed
141141 |> Array.tryPick ( fun ( kv : KeyValuePair < ProjectKey , ProjectOptions >) ->
@@ -156,7 +156,7 @@ let isOSX () =
156156open TestsConfig
157157
158158let tests ( suiteConfig : TestSuiteConfig ) =
159-
159+
160160 let prepareTestsAssets = lazy (
161161 let logger = Log.create " Tests Assets"
162162 let fs = FileUtils( logger)
@@ -253,13 +253,13 @@ let tests (suiteConfig: TestSuiteConfig) =
253253 let parsed = loader.Projects
254254
255255 Expect.equal parsed.Length 1 " lib"
256-
256+
257257 let l1Parsed =
258258 parsed
259259 |> expectFind projPath { ProjectKey.ProjectPath = projPath; TargetFramework = " net461" } " a lib"
260260
261261 let expectedSources =
262- let sourceFiles =
262+ let sourceFiles =
263263 [ projDir / " AssemblyInfo.fs"
264264 projDir / " Library.fs" ]
265265
@@ -296,7 +296,7 @@ let tests (suiteConfig: TestSuiteConfig) =
296296 let parsed = loader.Projects
297297
298298 Expect.equal parsed.Length 1 " console and lib"
299-
299+
300300 let n1Parsed =
301301 parsed
302302 |> expectFind projPath { ProjectKey.ProjectPath = projPath; TargetFramework = " netstandard2.0" } " first is a lib"
@@ -503,7 +503,7 @@ let tests (suiteConfig: TestSuiteConfig) =
503503 let parsed = loader.Projects
504504
505505 Expect.equal parsed.Length 3 " c1, l1, l2"
506-
506+
507507 let c1 = testDir/ ( `` sample6 Netsdk Sparse/1 `` .ProjectFile)
508508 let c1Dir = Path.GetDirectoryName c1
509509
@@ -569,6 +569,46 @@ let tests (suiteConfig: TestSuiteConfig) =
569569 Expect.isTrue ( File.Exists outputPath) ( sprintf " output assembly '%s ' not found" outputPath)
570570 )
571571
572+ testCase |> withLog " can load sample9" ( fun logger fs ->
573+ let testDir = inDir fs " load_sample9"
574+ copyDirFromAssets fs `` sample9 NetSdk library `` .ProjDir testDir
575+ // fs.cp (``sample9 NetSdk library``.ProjDir/"Directory.Build.props") testDir
576+
577+ let projPath = testDir/ ( `` sample9 NetSdk library `` .ProjectFile)
578+ let projDir = Path.GetDirectoryName projPath
579+
580+ dotnet fs [ " restore" ; projPath]
581+ |> checkExitCodeZero
582+
583+ let loader = createLoader logger
584+
585+ let watcher = watchNotifications logger loader
586+
587+ loader.LoadProjects [ projPath]
588+
589+ [ loading " n1.fsproj" ; loaded " n1.fsproj" ]
590+ |> expectNotifications ( watcher.Notifications)
591+
592+ let [_; WorkspaceProjectState.Loaded(n1Loaded,_)] = watcher.Notifications
593+
594+ let parsed = loader.Projects
595+
596+ Expect.equal parsed.Length 1 " console and lib"
597+
598+ let n1Parsed =
599+ parsed
600+ |> expectFind projPath { ProjectKey.ProjectPath = projPath; TargetFramework = " netstandard2.0" } " first is a lib"
601+
602+ let expectedSources =
603+ [ projDir / " obj2/Debug/netstandard2.0/n1.AssemblyInfo.fs"
604+ projDir / " Library.fs" ]
605+ |> List.map Path.GetFullPath
606+
607+ Expect.equal n1Parsed.SourceFiles expectedSources " check sources"
608+
609+ Expect.equal n1Parsed n1Loaded " notificaton and parsed should be the same"
610+ )
611+
572612 ]
573613
574614 let invalid =
@@ -607,7 +647,7 @@ let tests (suiteConfig: TestSuiteConfig) =
607647 let parsed = loader.Projects
608648
609649 Expect.equal parsed.Length 0 " no project loaded"
610-
650+
611651 Expect.equal ( watcher.Notifications |> List.item 1 ) ( WorkspaceProjectState.Failed( wrongPath, ( GetProjectOptionsErrors.GenericError( wrongPath, " not found" )))) " check error type"
612652 )
613653
@@ -632,7 +672,7 @@ let tests (suiteConfig: TestSuiteConfig) =
632672 let parsed = loader.Projects
633673
634674 Expect.equal parsed.Length 0 " no project loaded"
635-
675+
636676 Expect.equal ( watcher.Notifications |> List.item 1 ) ( WorkspaceProjectState.Failed( projPath, ( GetProjectOptionsErrors.ProjectNotRestored projPath))) " check error type"
637677 )
638678
@@ -801,7 +841,7 @@ let tests (suiteConfig: TestSuiteConfig) =
801841 loader.LoadProjects [ projPath]
802842
803843 let parsed = loader.Projects
804-
844+
805845 let l1Parsed =
806846 parsed
807847 |> expectFind projPath { ProjectKey.ProjectPath = projPath; TargetFramework = " net461" } " a lib"
@@ -834,7 +874,7 @@ let tests (suiteConfig: TestSuiteConfig) =
834874 loader.LoadProjects [ projPath]
835875
836876 let parsed = loader.Projects
837-
877+
838878 let n1Parsed =
839879 parsed
840880 |> expectFind projPath { ProjectKey.ProjectPath = projPath; TargetFramework = " netstandard2.0" } " first is a lib"
@@ -1000,7 +1040,7 @@ let tests (suiteConfig: TestSuiteConfig) =
10001040 loader.LoadProjects [ projPath]
10011041
10021042 let parsed = loader.Projects
1003-
1043+
10041044 let n1Parsed =
10051045 parsed
10061046 |> expectFind projPath { ProjectKey.ProjectPath = projPath; TargetFramework = " netstandard2.0" } " first is a lib"
0 commit comments