-
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.
Fix for #99: AddTatinDependencies did not accept project alias
- Loading branch information
Showing
11 changed files
with
174 additions
and
18 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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
R←Test_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') | ||
R←T._Failed | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
|
||
configfile←tempDir,'/cider.config' | ||
config←##.Cider.Get_JSON5 configfile | ||
config.CIDER.dependencies.tatin←'tatin-packages' | ||
config ##.Cider.Put_JSON5 configfile | ||
|
||
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
parms←##.Cider.CreateOpenParms'' | ||
parms.folder←tempDir | ||
parms.batch←1 | ||
parms.ignoreUserExec←1 | ||
|
||
(success log)←##.Cider.OpenProject parms | ||
→T.GoToTidyUp~success | ||
→T.GoToTidyUp∨/'ERROR'⍷log | ||
|
||
list←##.Cider.AddTatinDependencies'[tatin]APLTreeUtils2,[tatin]FilesAndDirs'tempDir 0 | ||
→T.GoToTidyUp 2≠≢list | ||
|
||
res←(~parms.batch)##.Cider.CloseProject tempDir | ||
→T.GoToTidyUp res≠1 | ||
|
||
#.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 res≠1 | ||
|
||
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,52 @@ | ||
R←Test_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') | ||
R←T._Failed | ||
|
||
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' | ||
folder←∆GetTestPath⊃⎕SI | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
tempDir ⎕NCOPY⍠1⊢folder,'/*' | ||
alias←'MyAliias_',⊃⎕SI | ||
res←⎕SE.Cider.AddAlias tempDir alias | ||
Assert 0=≢res | ||
|
||
configfile←tempDir,'/cider.config' | ||
config←##.Cider.Get_JSON5 configfile | ||
config.CIDER.dependencies.tatin←'tatin-packages' | ||
config ##.Cider.Put_JSON5 configfile | ||
|
||
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
parms←##.Cider.CreateOpenParms'' | ||
parms.folder←tempDir | ||
parms.batch←1 | ||
parms.ignoreUserExec←1 | ||
|
||
(success log)←##.Cider.OpenProject parms | ||
→T.GoToTidyUp~success | ||
→T.GoToTidyUp∨/'ERROR'⍷log | ||
|
||
list←##.Cider.AddTatinDependencies'https://tatin.dev/APLTreeUtils2'('[',alias,']')0 | ||
→T.GoToTidyUp 1≠≢list | ||
|
||
res←(~parms.batch)##.Cider.CloseProject tempDir | ||
→T.GoToTidyUp res≠1 | ||
|
||
#.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 res≠1 | ||
|
||
R←T._OK | ||
|
||
∆TidyUp: | ||
##.Cider.C.Cleanup | ||
{}∆LINK'Break' '#.TEMP' | ||
FilesAndDirs.RmDir tempDir,'/..' | ||
⎕SE.Cider.DropAlias alias | ||
⍝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
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,2 @@ | ||
r←Hello | ||
r←'World' |
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,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: { | ||
}, | ||
} |
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,2 @@ | ||
r←Hello | ||
r←'World' |
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,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: { | ||
}, | ||
} |