-
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.
CloseProject simplified and enhanced: processes now unqualified names…
…pace names as well
- Loading branch information
Showing
17 changed files
with
169 additions
and
47 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
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,32 @@ | ||
R←Test_OpenAndClose_005(stopFlag batchFlag);⎕TRAP;tempDir;list;sourceFolder1;projectFolder1;rc;res;buff;msg;ref | ||
⍝ Opens a (new) project and then closes it with a namespace name that is not fully qualified | ||
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N') | ||
R←T._Failed | ||
|
||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
projectFolder1←tempDir,'/Foo' | ||
sourceFolder1←projectFolder1,'/APLSource' | ||
'Create!'FilesAndDirs.CheckPath sourceFolder1 | ||
(projectFolder1,'/cider.config')⎕NCOPY(##.CiderConfig.HOME,'/TestData/cider.config.Foo') | ||
#.⎕EX'TEMP' ⋄ 'TEMP.Foo'#.⎕NS'' | ||
ref←∆GetRefToCommTools | ||
ref.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(rc msg buff)←∆UCMD'CreateProject "',projectFolder1,'" #.TEMP.Foo -noEdit -acceptConfig -batch -ignoreUserExec' | ||
Assert rc=0 | ||
#.TEMP.Foo.⎕FX'r←Hello' 'r←''World''' | ||
{}⎕SE.Link.Add'#.TEMP.Foo.Hello' | ||
list←FilesAndDirs.ListFiles projectFolder1 | ||
→T.GoToTidyUp 1≠≢list | ||
→T.GoToTidyUp ##.Cider.ConfigFilename≢⊃,/1↓⎕NPARTS 1⊃list | ||
|
||
→T.GoToTidyUp 1≠0 ##.Cider.CloseProject #.TEMP.{⍺ ⍺⍺ ⍵}'Foo' ⍝ The dfn makes sure that the namespace is correctly qualified | ||
|
||
R←T._OK | ||
|
||
∆TidyUp: | ||
ref.Cleanup | ||
∆LINK'Break' '#.TEMP.Foo' ⍝ We DO NOT check here because when everything is working fine... | ||
rc←FilesAndDirs.RmDir tempDir,'/..' | ||
Assert 0=+/∊rc | ||
#.⎕EX'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
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_301(stopFlag batchFlag);⎕TRAP;tempDir;parms;list;rc;msg;res;log;ref;noOf | ||
⍝ Exercise the user command on "CloseProject" with a non-qualified namespace name called from # | ||
⍝ Should work anyway if there is just one project with that name | ||
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') | ||
r←T._Failed | ||
|
||
#.⎕EX'Foo' ⋄ 'Foo'#.⎕NS'' | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
(tempDir,'/cider.config')⎕NCOPY(##.CiderConfig.HOME,'/TestData/cider.config.Foo') | ||
3 ⎕MKDIR tempDir,'/APLSource' | ||
|
||
ref←∆GetRefToCommTools | ||
ref.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(rc msg res)←∆UCMD'CreateProject "',tempDir,'" -noEdit -acceptConfig -batch -ignoreUserExec' | ||
Assert rc=0 | ||
(rc msg res)←∆UCMD'CloseProject #.Foo -fast' | ||
Assert rc=0 | ||
|
||
parms←##.Cider.CreateOpenParms ⍬ | ||
parms.folder←tempDir | ||
parms.watch←'ns' | ||
parms.parent←'#.Foo' | ||
parms.ignoreUserExec←1 | ||
parms.batch←1 | ||
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(res log)←##.Cider.OpenProject parms | ||
|
||
→T.GoToTidyUp 0=≢list←##.Cider.ListOpenProjects 0 | ||
|
||
noOf←⎕SE.UCMD #.{⍺⍺ ⍵}'Cider.CloseProject Foo.Foo -fast' ⍝ We MUST NOT use ∆UCMD here, otherwise we cannot establoish where CloseProject was called from | ||
→T.GoToTidyUp'Number of projects closed: 1'≢noOf | ||
|
||
r←T._OK | ||
|
||
∆TidyUp: | ||
ref.Cleanup | ||
##.Cider.C.Cleanup | ||
∆LINK'Break' '#.Foo.Foo' ⍝ We DO NOT check here because when everything is working fine then it's not linked anymore. | ||
rc←FilesAndDirs.RmDir tempDir,'/..' | ||
Assert 0=+/∊rc | ||
#.⎕EX'Foo' | ||
⍝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_302(stopFlag batchFlag);⎕TRAP;tempDir;parms;list;rc;msg;res;log;ref;noOf | ||
⍝ Exercise the user command on "CloseProject" with a non-qualified namespace name, called from #.Foo | ||
⍝ Should work anyway if there is just one project with that name | ||
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') | ||
r←T._Failed | ||
|
||
#.⎕EX'Foo' ⋄ 'Foo'#.⎕NS'' | ||
tempDir←∆GetFolderInTempDir⊃⎕SI | ||
(tempDir,'/cider.config')⎕NCOPY(##.CiderConfig.HOME,'/TestData/cider.config.Foo') | ||
3 ⎕MKDIR tempDir,'/APLSource' | ||
|
||
ref←∆GetRefToCommTools | ||
ref.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(rc msg res)←∆UCMD'CreateProject "',tempDir,'" -noEdit -acceptConfig -batch -ignoreUserExec' | ||
Assert rc=0 | ||
(rc msg res)←∆UCMD'CloseProject #.Foo -fast' | ||
Assert rc=0 | ||
|
||
parms←##.Cider.CreateOpenParms ⍬ | ||
parms.folder←tempDir | ||
parms.watch←'ns' | ||
parms.parent←'#.Foo' | ||
parms.ignoreUserExec←1 | ||
parms.batch←1 | ||
##.Cider.C.YesOrNo_Answers←1 2⍴'ChangeCurrentDir@' 'n' | ||
(res log)←##.Cider.OpenProject parms | ||
|
||
→T.GoToTidyUp 0=≢list←##.Cider.ListOpenProjects 0 | ||
|
||
noOf←⎕SE.UCMD #.Foo.{⍺⍺ ⍵}'Cider.CloseProject Foo -fast' ⍝ We MUST NOT use ∆UCMD here, otherwise we cannot establoish where CloseProject was called from | ||
→T.GoToTidyUp'Number of projects closed: 1'≢noOf | ||
|
||
r←T._OK | ||
|
||
∆TidyUp: | ||
ref.Cleanup | ||
##.Cider.C.Cleanup | ||
∆LINK'Break' '#.Foo.Foo' ⍝ We DO NOT check here because when everything is working fine then it's not linked anymore. | ||
rc←FilesAndDirs.RmDir tempDir,'/..' | ||
Assert 0=+/∊rc | ||
#.⎕EX'Foo' | ||
⍝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
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
Oops, something went wrong.