Skip to content

Commit

Permalink
Bug fix in LoadDependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aplteam committed Mar 11, 2023
1 parent 7324cdb commit 02d5885
Show file tree
Hide file tree
Showing 335 changed files with 763 additions and 161 deletions.
2 changes: 1 addition & 1 deletion APLSource/Client/LoadDependencies.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
:EndIf
('Folder does not exist:',installFolder)Assert ⎕NEXISTS installFolder
:If 0=targetSpace
installFolder(1+isUC)'#' '⎕SE'
targetSpace(1+isUC)'#' '⎕SE'
:EndIf
rrefs
targetSpacetargetSpace
Expand Down
2 changes: 2 additions & 0 deletions APLSource/Registry/History.apla
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(
'* 0.90.1 ⋄ 2023-03-11'
' * Bug fix in `LoadDependencies`: did not work when only one right argument was provided'
'* 0.90.0 ⋄ 2023-02-27'
' * BREAKING CHANGE: syntax and behaviour of the `LoadDependencies` function has changed'
' * BREAKING CHANGE: behaviour of the `]LoadDependencies` user command has changed'
Expand Down
2 changes: 1 addition & 1 deletion APLSource/Registry/Version.aplf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rVersion
See also `History`
r'Tatin' '0.90.0+1485' '2023-02-27'
r'Tatin' '0.90.1+1488' '2023-03-11'
20 changes: 18 additions & 2 deletions APLSource/Tatin.dyalog
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:Namespace Tatin
The ]Tatin user commands for managing packages.\\
* 0.60.0 - 2023-02-26
* 0.61.0 - 2023-03-01

⎕IO1 ⎕ML1

Expand Down Expand Up @@ -2253,7 +2253,7 @@

IsAbsolutePath{'/'=1:1 ':':1 '//'2}

folder{quietFlag}EstablishPackageFolder folder;list;ind
folder{quietFlag}EstablishPackageFolder folder;list;ind;cfg;buff
Checks first whether it's meant to be an open Cider project (if Cider is around).
Next it tries to find it in the current dir.
The user should always be asked for confirmation.
Expand All @@ -2265,6 +2265,22 @@
:If 0<⎕SE.⎕NC'Cider'
:If 1=list⎕SE.Cider.ListOpenProjects 0
folder'expand'TC.F.NormalizePath(2list[1;]),'/',folder
:If 0=TC.F.IsFile folder,'apl-dependencies.txt'
cfgTC.Reg.JSONTC.F.NGET folder,'cider.config'
:If 0=cfg.CIDER.tatinFolder
folder''
:ElseIf ','cfg.CIDER.tatinFolder
buff{¯1+'='}¨','()cfg.CIDER.tatinFolder
ind'Select target folder:'TC.CommTools.Select folder,¨buff
:If 0=ind
folder''
:Else
folder,indbuff
:EndIf
:Else
folder{¯1+'='}cfg.CIDER.tatinFolder
:EndIf
:EndIf
:ElseIf 0=list
:If TC.F.IsDir TC.F.PWD,'/',folder
folderTC.F.PWD,'/',folder
Expand Down
10 changes: 5 additions & 5 deletions APLSource/TestCases/Test_API_011.aplf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rTest_API_011(stopFlag batchFlag);⎕TRAP;res;rc;msg;list;zip1;zip2;expected;Done;dir1;dir2
rTest_API_011(stopFlag batchFlag);⎕TRAP;res;rc;msg;list;zip1;zip2;expected;Done
Exercise "InstallPackages" with multiple packages that are user commands
⎕TRAP(999 'C' '. ⍝ Deliberate error')(0 'N')
rT._Failed
Expand All @@ -9,14 +9,14 @@
expected'example-UC-1.0.0' 'example-UC_2-1.0.0'
T.GoToTidyUp expectedres

T.GoToTidyUp~TC.F.IsDir dir1TC.GetMyUCMDsFolder'UC/example-UC-1.0.0'
T.GoToTidyUp~TC.F.IsDir dir2TC.GetMyUCMDsFolder'UC_2/example-UC_2-1.0.0'
T.GoToTidyUp~TC.F.IsDir TC.GetMyUCMDsFolder'UC/example-UC-1.0.0'
T.GoToTidyUp~TC.F.IsDir TC.GetMyUCMDsFolder'UC_2/example-UC_2-1.0.0'

rT._OK

∆TidyUp:
(rc msg)F.RmDirByForce dir1
(rc msg)F.RmDirByForce TC.GetMyUCMDsFolder'UC'
Assert rc=0
(rc msg)F.RmDirByForce dir2
(rc msg)F.RmDirByForce TC.GetMyUCMDsFolder'UC_2'
Assert rc=0
Done
35 changes: 35 additions & 0 deletions APLSource/TestCases/Test_InstallAndLoad_042.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
rTest_InstallAndLoad_042(stopFlag batchFlag);⎕TRAP;dir;src;zip;body;cfg;zipfile;installFolder;res;rc;msg
Install and load simple package without specifying a target namespace; was once a bug
Must be loaded into #
⎕TRAP(999 'C' '. ⍝ Deliberate error')(0 'N')
rT._Failed

dir∆GetTempDir''
(src zip)(dir,'/'),¨'src' 'reg'
F.MkDir src zip

body':Namespace CrazyName___' '∇r←PI' 'r←3.14' '' ':EndNamespace'
(body)F.NPUT src,'/CrazyName___.apln'
cfgTC.InitPackageConfig
cfg.(group name version)'Example' 'CrazyName___' '0.1.0'
cfg.source'CrazyName___.apln'
cfg.api'CrazyName___'
cfg.os_win1
TC.WritePackageConfigFile src cfg
zipfileTC.BuildPackage src zip''
installFolder∆GetTempDir'/MyAppPackages'
{}TC.InstallPackages('file://',zipfile)installFolder

resTC.LoadDependenciesinstallFolder Only one argument
T.GoToTidyUp'#._tatin.Example_CrazyName____0_1_0',/res
T.GoToTidyUp 9#._tatin.⎕NC'Example_CrazyName____0_1_0'
T.GoToTidyUp 9#.⎕NC'CrazyName___'

rT._OK

∆TidyUp:
#.⎕EX'CrazyName___'
(rc msg)F.RmDirByForce dir
Assert 0=rc
#._tatin.⎕EX'Example_CrazyName____0_1_0'
Done
Loading

0 comments on commit 02d5885

Please sign in to comment.