Skip to content

Commit

Permalink
Fix for #99: AddTatinDependencies did not accept project alias
Browse files Browse the repository at this point in the history
  • Loading branch information
aplteam committed Jan 7, 2025
1 parent 8af9a1f commit 462fe81
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 18 deletions.
11 changes: 1 addition & 10 deletions APLSource/.linkconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@

{
LinkVersion: { ID: "4.0.20"},

Settings: {
fastLoad: 1,
forceFilenames: 1,
watch: "both",
},
}
{ LinkVersion: { ID: "4.0.20"}, Settings: { fastLoad: 1, forceFilenames: 1, watch: "both", },}
Expand Down
3 changes: 3 additions & 0 deletions APLSource/Cider/AddTatinDependencies.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
:If 1<packageIDs
packageIDs1,/',',¨packageIDs
:EndIf
:If /'[]'projectFolder
projectFolderGetFolderFromAlias2 projectFolder
:EndIf
cfgReadProjectConfigFile projectFolder
:If dev
refcfg.CIDER.dependencies_dev
Expand Down
2 changes: 1 addition & 1 deletion APLSource/Cider/UC/AddTatinDependencies.aplf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
development0 Args.Switch'development'
targetNamespace''Args.Switch'target'
:If IsAlias projectFolder
projectFolderP.GetFolderFromAlias projectFolder
projectFolderP.##.GetFolderFromAlias2 projectFolder
:Else
projectFolder'GetProjectPathForAddingTatinPkgs@Which project would you like to add Tatin packages to?'GetProjectPath projectFolder
:EndIf
Expand Down
7 changes: 3 additions & 4 deletions APLSource/TestCases/Test_AddTatinDep_001.aplf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RTest_AddTatinDep_001(stopFlag batchFlag);⎕TRAP;folder;tempDir;parms;log;res;list;success;configfile;config
Exercise AddTatinDependencies
Exercise AddTatinDependencies in its most simple form: single package from https://tatin.dev
⎕TRAP(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
RT._Failed

Expand All @@ -23,8 +23,8 @@
T.GoToTidyUp~success
T.GoToTidyUp/'ERROR'log

list##.Cider.AddTatinDependencies'[tatin]APLTreeUtils2,[tatin]FilesAndDirs'tempDir 0
T.GoToTidyUp 2list
list##.Cider.AddTatinDependencies'https://tatin.dev/APLTreeUtils2'tempDir 0
T.GoToTidyUp 1list

res(~parms.batch)##.Cider.CloseProject tempDir
T.GoToTidyUp res1
Expand All @@ -35,7 +35,6 @@
T.GoToTidyUp/'ERROR'log

{}#.TEMP.APLTreeUtils2.GetOperatingSystem
{}#.TEMP.FilesAndDirs.PWD

res(~parms.batch)##.Cider.CloseProject tempDir
T.GoToTidyUp res1
Expand Down
49 changes: 49 additions & 0 deletions APLSource/TestCases/Test_AddTatinDep_002.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
RTest_AddTatinDep_002(stopFlag batchFlag);⎕TRAP;folder;tempDir;parms;log;res;list;success;configfile;config
Exercise AddTatinDependencies with alias names: two packages, both with a registry alias
⎕TRAP(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
RT._Failed

#.⎕SHADOW'TEMP' 'TEMP'#.⎕NS''
folder∆GetTestPath⎕SI
tempDir∆GetFolderInTempDir⎕SI
tempDir ⎕NCOPY1folder,'/*'

configfiletempDir,'/cider.config'
config##.Cider.Get_JSON5 configfile
config.CIDER.dependencies.tatin'tatin-packages'
config ##.Cider.Put_JSON5 configfile

##.Cider.C.YesOrNo_Answers1 2'ChangeCurrentDir@' 'n'
parms##.Cider.CreateOpenParms''
parms.foldertempDir
parms.batch1
parms.ignoreUserExec1

(success log)##.Cider.OpenProject parms
T.GoToTidyUp~success
T.GoToTidyUp/'ERROR'log

list##.Cider.AddTatinDependencies'[tatin]APLTreeUtils2,[tatin]FilesAndDirs'tempDir 0
T.GoToTidyUp 2list

res(~parms.batch)##.Cider.CloseProject tempDir
T.GoToTidyUp res1

#.TEMP.(⎕EX ⎕NL-9)
(success log)##.Cider.OpenProject parms
T.GoToTidyUp~success
T.GoToTidyUp/'ERROR'log

{}#.TEMP.APLTreeUtils2.GetOperatingSystem
{}#.TEMP.FilesAndDirs.PWD

res(~parms.batch)##.Cider.CloseProject tempDir
T.GoToTidyUp res1

RT._OK

∆TidyUp:
##.Cider.C.Cleanup
{}∆LINK'Break' '#.TEMP'
FilesAndDirs.RmDir tempDir,'/..'
Done
52 changes: 52 additions & 0 deletions APLSource/TestCases/Test_AddTatinDep_003.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
RTest_AddTatinDep_003(stopFlag batchFlag);⎕TRAP;folder;tempDir;parms;log;res;list;success;configfile;config;alias
Exercise AddTatinDependencies and add a package
⎕TRAP(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
RT._Failed

#.⎕SHADOW'TEMP' 'TEMP'#.⎕NS''
folder∆GetTestPath⎕SI
tempDir∆GetFolderInTempDir⎕SI
tempDir ⎕NCOPY1folder,'/*'
alias'MyAliias_',⎕SI
res⎕SE.Cider.AddAlias tempDir alias
Assert 0=res

configfiletempDir,'/cider.config'
config##.Cider.Get_JSON5 configfile
config.CIDER.dependencies.tatin'tatin-packages'
config ##.Cider.Put_JSON5 configfile

##.Cider.C.YesOrNo_Answers1 2'ChangeCurrentDir@' 'n'
parms##.Cider.CreateOpenParms''
parms.foldertempDir
parms.batch1
parms.ignoreUserExec1

(success log)##.Cider.OpenProject parms
T.GoToTidyUp~success
T.GoToTidyUp/'ERROR'log

list##.Cider.AddTatinDependencies'https://tatin.dev/APLTreeUtils2'('[',alias,']')0
T.GoToTidyUp 1list

res(~parms.batch)##.Cider.CloseProject tempDir
T.GoToTidyUp res1

#.TEMP.(⎕EX ⎕NL-9)
(success log)##.Cider.OpenProject parms
T.GoToTidyUp~success
T.GoToTidyUp/'ERROR'log

{}#.TEMP.APLTreeUtils2.GetOperatingSystem

res(~parms.batch)##.Cider.CloseProject tempDir
T.GoToTidyUp res1

RT._OK

∆TidyUp:
##.Cider.C.Cleanup
{}∆LINK'Break' '#.TEMP'
FilesAndDirs.RmDir tempDir,'/..'
⎕SE.Cider.DropAlias alias
Done
10 changes: 7 additions & 3 deletions APLSource/TestCases/Test_UC_047.aplf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RTest_UC_047(stopFlag batchFlag);⎕TRAP;res;msg;rc;folder;parms;tempDir;success;log;stop;expected
Exercise ]Cider.AddTatinDependencies without loading
RTest_UC_047(stopFlag batchFlag);⎕TRAP;res;msg;rc;folder;parms;tempDir;success;log;stop;expected;alias
Exercise ]Cider.AddTatinDependencies without loading; uses a projet alias
⎕TRAP(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
RT._Failed

Expand All @@ -11,6 +11,9 @@
folder∆GetTestPath⎕SI
tempDir∆GetFolderInTempDir⎕SI
tempDir ⎕NCOPY1folder,'/*'
alias'MyAliias_',⎕SI
res⎕SE.Cider.AddAlias tempDir alias
Assert 0=res

parms##.Cider.CreateOpenParms''
parms.folder⎕NPARTS tempDir
Expand All @@ -26,7 +29,7 @@
stop0
##.Cider.C.AddAutomation'YesOrNo' 'AddTatinDeps@' 'y'
##.Cider.C.AddAutomation'YesOrNo' 'LoadTatinDependenciesAfterAdding@' 'n'
(rc msg res)stop ∆UCMD'AddTatinDependencies FilesAndDirs,APLTreeUtils2 "',tempDir,'"'
(rc msg res)stop ∆UCMD'AddTatinDependencies FilesAndDirs,APLTreeUtils2 [',alias,']'
T.GoToTidyUp rc0
T.GoToTidyUp 0msg
expected'2 Tatin dependencies added:' 'aplteam-FilesAndDirs-' 'aplteam-APLTreeUtils2-'
Expand All @@ -38,4 +41,5 @@
##.Cider.C.Cleanup
{}∆LINK'Break' '#.TEMP'
FilesAndDirs.RmDir tempDir,'/..'
⎕SE.Cider.DropAlias alias
Done
2 changes: 2 additions & 0 deletions Tests/Test_AddTatinDep_002/APLSource/Hello.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rHello
r'World'
27 changes: 27 additions & 0 deletions Tests/Test_AddTatinDep_002/cider.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
CIDER: {
dependencies: {
tatin: "",
},
dependencies_dev: {
tatin: "",
},
distributionFolder: "",
init: "",
make: "",
parent: "#",
projectSpace: "TEMP",
project_url: "",
source: "APLSource",
tests: "",
},
LINK: {
watch: "ns",
},
SYSVARS: {
io: 1,
ml: 1,
},
USER: {
},
}
2 changes: 2 additions & 0 deletions Tests/Test_AddTatinDep_003/APLSource/Hello.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rHello
r'World'
27 changes: 27 additions & 0 deletions Tests/Test_AddTatinDep_003/cider.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
CIDER: {
dependencies: {
tatin: "",
},
dependencies_dev: {
tatin: "",
},
distributionFolder: "",
init: "",
make: "",
parent: "#",
projectSpace: "TEMP",
project_url: "",
source: "APLSource",
tests: "",
},
LINK: {
watch: "ns",
},
SYSVARS: {
io: 1,
ml: 1,
},
USER: {
},
}

0 comments on commit 462fe81

Please sign in to comment.