-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test cases added (AddTatinDependencies) and improved (NuGet-related)
- Loading branch information
Showing
19 changed files
with
301 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
r←Version | ||
⍝ See also `History` | ||
r←'0.41.0-beta-4+671' | ||
r←'0.41.0-beta-5+671' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,15 @@ | ||
R←Test_UC_045(stopFlag batchFlag);⎕TRAP;res;msg;rc;folder;parms;tempDir;success;log | ||
R←Test_UC_045(stopFlag batchFlag);⎕TRAP;tempFolder;parms;I;rc;msg | ||
⍝ Exercise ]Cider.AddNuGetDependencies and ListNuGetDependencies | ||
⍝ The real test function (∆Test_UC_045) is executed in its own APL process | ||
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N') | ||
R←T._Failed | ||
|
||
:If 1 1≢2250⌶0 ⍝ We need .NET Core and a successfully loaded .NET bridge | ||
R←T._NotApplicable ⋄ →0 | ||
:EndIf | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
|
||
parms←##.Cider.CreateOpenParms'' | ||
parms.folder←∊⎕NPARTS tempDir | ||
parms.noPkgLoad←0 | ||
parms.batch←1 | ||
parms.ignoreUserExec←1 | ||
|
||
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(success log)←##.Cider.OpenProject parms | ||
→T.GoToTidyUp~success | ||
→T.GoToTidyUp∨/'ERROR'⍷log | ||
|
||
{}##.Cider.AddNuGetDependencies'Clock,NodaTime'tempDir ⍝ Clock is already installed | ||
|
||
(rc msg res)←∆UCMD'ListNuGetDependencies "',tempDir,'"' | ||
→T.PassesIf rc=0 | ||
→T.PassesIf 0=≢msg | ||
→T.PassesIf 2=≢res | ||
→T.PassesIf 2=2⊃⍴res | ||
|
||
R←T._OK | ||
tempFolder←∆GetFolderInTempDir⊃⎕SI | ||
parms←∆NuGetTestProcessParms(⊃⎕SI)tempFolder | ||
I←⎕NEW APLProcess(,⊂parms) | ||
R←I.ExitCode | ||
|
||
∆TidyUp: | ||
##.Cider.C.Cleanup | ||
{}∆LINK'Break' '#.TEMP' | ||
FilesAndDirs.RmDir tempDir,'/..' ⍝ Does not work: the .NET DLL blocks this; there is no way around this at the time of writing (October 2023) | ||
(rc msg)←FilesAndDirs.RmDirByForce tempFolder | ||
msg Assert 0=rc | ||
⍝Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
R←Test_UC_046(stopFlag batchFlag);⎕TRAP;res;msg;rc;folder;parms;tempDir;success;log;stop;expected | ||
⍝ Exercise ]Cider.AddTatinDependencies and ListTatinDependencies | ||
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N') | ||
R←T._Failed | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
|
||
parms←##.Cider.CreateOpenParms'' | ||
parms.folder←∊⎕NPARTS tempDir | ||
parms.noPkgLoad←0 | ||
parms.batch←1 | ||
parms.ignoreUserExec←1 | ||
|
||
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(success log)←##.Cider.OpenProject parms | ||
→T.GoToTidyUp~success | ||
→T.GoToTidyUp∨/'ERROR'⍷log | ||
|
||
stop←0 | ||
##.Cider.C.YesOrNo_Answers←1 2⍴'AddTatinDeps@' 'y' | ||
##.Cider.C.YesOrNo_Answers⍪←'LoadTatinDependenciesAfterAdding@' 'y' | ||
(rc msg res)←stop ∆UCMD'AddTatinDependencies FilesAndDirs,APLTreeUtils2 "',tempDir,'"' | ||
→T.GoToTidyUp rc≠0 | ||
→T.GoToTidyUp 0≠≢msg | ||
expected←'2 Tatin dependencies added:' 'aplteam-FilesAndDirs-5.7.1' 'aplteam-APLTreeUtils2-1.4.0' '2 dependencies were loaded' | ||
→T.GoToTidyUp expected≢APLTreeUtils2.DLB,res | ||
|
||
(rc msg res)←stop ∆UCMD'ListTatinDependencies "',tempDir,'" -raw' ⍝ Nothing was installed earlier | ||
→T.GoToTidyUp rc≠0 | ||
→T.GoToTidyUp 0≠≢msg | ||
→T.GoToTidyUp 2≠+/res[;3] | ||
|
||
R←T._OK | ||
|
||
∆TidyUp: | ||
##.Cider.C.Cleanup | ||
{}∆LINK'Break' '#.TEMP' | ||
FilesAndDirs.RmDir tempDir,'/..' | ||
⍝Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
R←Test_UC_047(stopFlag batchFlag);⎕TRAP;res;msg;rc;folder;parms;tempDir;success;log;stop;expected | ||
⍝ Exercise ]Cider.AddTatinDependencies without loading | ||
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N') | ||
R←T._Failed | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
|
||
parms←##.Cider.CreateOpenParms'' | ||
parms.folder←∊⎕NPARTS tempDir | ||
parms.noPkgLoad←0 | ||
parms.batch←1 | ||
parms.ignoreUserExec←1 | ||
|
||
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(success log)←##.Cider.OpenProject parms | ||
→T.GoToTidyUp~success | ||
→T.GoToTidyUp∨/'ERROR'⍷log | ||
|
||
stop←0 | ||
##.Cider.C.YesOrNo_Answers←1 2⍴'AddTatinDeps@' 'y' | ||
##.Cider.C.YesOrNo_Answers⍪←'LoadTatinDependenciesAfterAdding@' 'n' | ||
(rc msg res)←stop ∆UCMD'AddTatinDependencies FilesAndDirs,APLTreeUtils2 "',tempDir,'"' | ||
→T.GoToTidyUp rc≠0 | ||
→T.GoToTidyUp 0≠≢msg | ||
expected←'2 Tatin dependencies added:' 'aplteam-FilesAndDirs-5.7.1' 'aplteam-APLTreeUtils2-1.4.0' | ||
→T.GoToTidyUp expected≢APLTreeUtils2.DLB,res | ||
|
||
R←T._OK | ||
|
||
∆TidyUp: | ||
##.Cider.C.Cleanup | ||
{}∆LINK'Break' '#.TEMP' | ||
FilesAndDirs.RmDir tempDir,'/..' | ||
⍝Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,15 @@ | ||
R←Test_UC_050(stopFlag batchFlag);⎕TRAP;folder;res;log;cals;success;tempDir;config;msg;rc;stop;batch;Cleanup;ref | ||
R←Test_UC_050(stopFlag batchFlag);⎕TRAP;tempFolder;parms;I;rc;msg | ||
⍝ Open project, add 2 NuGet packages to default folder, load, call, list, close, re-open, close | ||
⍝ The real test function (∆Test_UC_050) is executed in its own APL process | ||
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N') | ||
R←T._Failed | ||
|
||
:If 1 1≢2250⌶0 ⍝ We need .NET Core and a successfully loaded .NET bridge | ||
R←T._NotApplicable ⋄ →0 | ||
:EndIf | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
|
||
ref←∆GetRefToCommTools | ||
ref.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
stop←0 | ||
(rc msg res)←stop ∆UCMD'OpenProject ',tempDir,' -projectSpace=TEMP -batch -ignoreUserExec' | ||
Assert rc=0 | ||
|
||
ref.YesOrNo_Answers←1 2⍴'LoadNuGetDependenciesAfterAdding@' 'y' | ||
(rc msg res)←stop ∆UCMD'AddNuGetDependencies Clock,NodaTime ',tempDir | ||
Assert rc=0 | ||
→T.GoToTidyUp 2≠+/'Clock' 'NodaTime'{0<≢('\b',⍺,'\b')⎕S 0⊣⍵}¨⊂res | ||
|
||
(rc msg res)←stop ∆UCMD'ListNuGetDependencies ',tempDir | ||
Assert rc=0 | ||
→T.GoToTidyUp 2≠≡res | ||
|
||
(rc msg res)←∆UCMD'CloseProject ',tempDir,' fast' | ||
Assert rc=0 | ||
→T.GoToTidyUp'Number of projects closed: 1'≢res | ||
|
||
#.TEMP.(⎕EX ⎕NL-⍳9) | ||
(rc msg res)←stop ∆UCMD'OpenProject ',tempDir,' -projectSpace=TEMP -batch -ignoreUserExec' | ||
Assert rc=0 | ||
→T.GoToTidyUp'Project successfully opened and established in "#.TEMP"'≢res~⎕TC | ||
→T.GoToTidyUp~(⊂'UtcNow')∊#.TEMP.Clock.⎕NL-2 | ||
→T.GoToTidyUp~∧/'Julian' 'Gregorian'∊⍕¨#.TEMP.NodaTime.CalendarSystem.⎕NL-2 | ||
|
||
(rc msg res)←∆UCMD'CloseProject ',tempDir,' -fast' | ||
Assert rc=0 | ||
|
||
R←T._OK | ||
tempFolder←∆GetFolderInTempDir⊃⎕SI | ||
parms←∆NuGetTestProcessParms(⊃⎕SI)tempFolder | ||
I←⎕NEW APLProcess(,⊂parms) | ||
R←I.ExitCode | ||
|
||
∆TidyUp: | ||
ref.Cleanup | ||
res←∆LINK'Break' '#.TEMP' | ||
FilesAndDirs.RmDir tempDir,'/..' ⍝ Does not work: the .NET DLL blocks this; there is no way around this at the time of writing (October 2023) | ||
(rc msg)←FilesAndDirs.RmDirByForce tempFolder | ||
msg Assert 0=rc | ||
⍝Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,15 @@ | ||
R←Test_UC_051(stopFlag batchFlag);⎕TRAP;folder;res;log;cals;success;tempDir;config;msg;rc;stop;batch;ref | ||
R←Test_UC_051(stopFlag batchFlag);⎕TRAP;tempFolder;parms;I;rc;msg | ||
⍝ Open project, add 2 NuGet packages to non-default folder, load, call, list, close, re-open, close | ||
⍝ The real test function (∆Test_UC_051) is executed in its own APL process | ||
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N') | ||
R←T._Failed | ||
|
||
:If 1 1≢2250⌶0 ⍝ We need .NET Core and a successfully loaded .NET bridge | ||
R←T._NotApplicable ⋄ →0 | ||
:EndIf | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
|
||
ref←∆GetRefToCommTools | ||
ref.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
stop←0 | ||
(rc msg res)←stop ∆UCMD'OpenProject ',tempDir,' -projectSpace=TEMP -batch -ignoreUserExec' | ||
Assert rc=0 | ||
|
||
ref.YesOrNo_Answers←1 2⍴'LoadNuGetDependenciesAfterAdding@' 'y' | ||
(rc msg res)←stop ∆UCMD'AddNuGetDependencies clock,NODATIME ',tempDir | ||
Assert rc=0 | ||
→T.GoToTidyUp~'Clock' 'NodaTime'∆LazyMatch res | ||
|
||
(rc msg res)←stop ∆UCMD'ListNuGetDependencies ',tempDir | ||
Assert rc=0 | ||
→T.GoToTidyUp 2≠≡res | ||
|
||
(rc msg res)←∆UCMD'CloseProject ',tempDir,' -fast' | ||
Assert rc=0 | ||
→T.GoToTidyUp'Number of projects closed: 1'≢res | ||
|
||
#.TEMP.(⎕EX ⎕NL-⍳9) | ||
(rc msg res)←stop ∆UCMD'OpenProject ',tempDir,' -projectSpace=TEMP -batch -ignoreUserExec' | ||
Assert rc=0 | ||
→T.GoToTidyUp'Project successfully opened and established in "#.TEMP"'≢res~⎕TC | ||
→T.GoToTidyUp~(⊂'UtcNow')∊#.TEMP.Clock.⎕NL-2 | ||
→T.GoToTidyUp~∧/'Julian' 'Gregorian'∊⍕¨#.TEMP.NodaTime.CalendarSystem.⎕NL-2 | ||
|
||
(rc msg res)←∆UCMD'CloseProject ',tempDir,' -fast' | ||
Assert rc=0 | ||
|
||
R←T._OK | ||
tempFolder←∆GetFolderInTempDir⊃⎕SI | ||
parms←∆NuGetTestProcessParms(⊃⎕SI)tempFolder | ||
I←⎕NEW APLProcess(,⊂parms) | ||
R←I.ExitCode | ||
|
||
∆TidyUp: | ||
ref.Cleanup | ||
res←∆LINK'Break' '#.TEMP' | ||
FilesAndDirs.RmDir tempDir,'/..' ⍝ Does not work: the .NET DLL blocks this; there is no way around this at the time of writing (October 2023) | ||
(rc msg)←FilesAndDirs.RmDirByForce tempFolder | ||
msg Assert 0=rc | ||
⍝Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
R←∆Test_UC_045(stopFlag batchFlag);⎕TRAP;res;msg;rc;folder;parms;tempDir;success;log | ||
⍝ Exercise ]Cider.AddNuGetDependencies and ListNuGetDependencies | ||
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N') | ||
R←T._Failed | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆TEMP_PATH | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
|
||
parms←##.Cider.CreateOpenParms'' | ||
parms.folder←∊⎕NPARTS tempDir | ||
parms.noPkgLoad←0 | ||
parms.batch←1 | ||
parms.ignoreUserExec←1 | ||
|
||
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(success log)←##.Cider.OpenProject parms | ||
→T.GoToTidyUp~success | ||
→T.GoToTidyUp∨/'ERROR'⍷log | ||
|
||
{}##.Cider.AddNuGetDependencies'Clock,NodaTime'tempDir ⍝ Clock is already installed | ||
|
||
(rc msg res)←∆UCMD'ListNuGetDependencies "',tempDir,'"' | ||
→T.GoToTidyUp rc≠0 | ||
→T.GoToTidyUp 0≠≢msg | ||
→T.GoToTidyUp 2≠≢res | ||
→T.GoToTidyUp 2≠2⊃⍴res | ||
|
||
R←T._OK | ||
|
||
∆TidyUp: | ||
##.Cider.C.Cleanup | ||
{}∆LINK'Break' '#.TEMP' | ||
⍝Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
R←∆Test_UC_050(stopFlag batchFlag);⎕TRAP;folder;res;log;cals;success;tempDir;config;msg;rc;stop;batch;Cleanup;ref | ||
⍝ Open project, add 2 NuGet packages to default folder, load, call, list, close, re-open, close | ||
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N') | ||
R←T._Failed | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆TEMP_PATH | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
|
||
ref←∆GetRefToCommTools | ||
ref.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
stop←0 | ||
(rc msg res)←stop ∆UCMD'OpenProject ',tempDir,' -projectSpace=TEMP -batch -ignoreUserExec' | ||
Assert rc=0 | ||
|
||
ref.YesOrNo_Answers←1 2⍴'LoadNuGetDependenciesAfterAdding@' 'y' | ||
(rc msg res)←stop ∆UCMD'AddNuGetDependencies Clock,NodaTime ',tempDir | ||
Assert rc=0 | ||
→T.GoToTidyUp 2≠+/'Clock' 'NodaTime'{0<≢('\b',⍺,'\b')⎕S 0⊣⍵}¨⊂res | ||
|
||
(rc msg res)←stop ∆UCMD'ListNuGetDependencies ',tempDir | ||
Assert rc=0 | ||
→T.GoToTidyUp 2≠≡res | ||
|
||
ref.YesOrNo_Answers⍪←1 2⍴'Do you wish to )CLEAR the workspace?' 'y' | ||
(rc msg res)←∆UCMD'CloseProject ',tempDir,' -fast' | ||
Assert rc=0 | ||
→T.GoToTidyUp~∨/'Number of projects closed: 1'∊res | ||
|
||
#.TEMP.(⎕EX ⎕NL-⍳9) | ||
(rc msg res)←stop ∆UCMD'OpenProject ',tempDir,' -projectSpace=TEMP -batch -ignoreUserExec' | ||
Assert rc=0 | ||
→T.GoToTidyUp'Project successfully opened and established in "#.TEMP"'≢res~⎕TC | ||
→T.GoToTidyUp~(⊂'UtcNow')∊#.TEMP.Clock.⎕NL-2 | ||
→T.GoToTidyUp~∧/'Julian' 'Gregorian'∊⍕¨#.TEMP.NodaTime.CalendarSystem.⎕NL-2 | ||
|
||
(rc msg res)←∆UCMD'CloseProject ',tempDir,' -fast' | ||
Assert rc=0 | ||
|
||
R←T._OK | ||
|
||
∆TidyUp: | ||
ref.Cleanup | ||
res←∆LINK'Break' '#.TEMP' | ||
⍝Done |
Oops, something went wrong.