diff --git a/APLSource/TestCases-11/E-1.aplf b/APLSource/TestCases-11/E-1.aplf deleted file mode 100644 index 8b019a3..0000000 --- a/APLSource/TestCases-11/E-1.aplf +++ /dev/null @@ -1,10 +0,0 @@ - {list}←E list -⍝ Get all functions into the editor starting their names with "Test_". - :If 0∊⍴list - list←'T'⎕NL 3 - :ElseIf 2=⍴⍴list - list←{⎕ML←3 ⋄ ⊃⍵}list[;⎕IO] - :Else - 'Invalid right argument'⎕SIGNAL 11 - :EndIf - {(0∊⍴⍵): ⋄ ⎕ML←3 ⋄ ⎕ED⊃⍵}&↓'Test_'{⍵⌿⍨⍺∧.=⍨(⍴,⍺)↑[1+⎕IO]⍵}list diff --git a/APLSource/TestCases-11/FailsIf-21.aplf b/APLSource/TestCases-11/FailsIf-21.aplf deleted file mode 100644 index 40cca6a..0000000 --- a/APLSource/TestCases-11/FailsIf-21.aplf +++ /dev/null @@ -1,5 +0,0 @@ - FailsIf←{ -⍝ Usage : →FailsIf x, where x is a boolean scalar - ⎕TRAP←(999 'E' '(⎕IO⊃⎕DM)⎕SIGNAL 999')(0 'N') - PassesIf~⍵ ⍝ Just PassesIf on negation - } diff --git a/APLSource/TestCases-11/FindSpecialString-811.aplf b/APLSource/TestCases-11/FindSpecialString-811.aplf deleted file mode 100644 index edace09..0000000 --- a/APLSource/TestCases-11/FindSpecialString-811.aplf +++ /dev/null @@ -1,11 +0,0 @@ - r←{startIn}FindSpecialString what;⎕IO;⎕ML -⍝ Use this to search for stuff like "CHECK" or "TODO" enclosed between `⍝` (⍵). -⍝ Without left argument the search starts in #. -⍝ However, at the time of writing the user command ]locate does not work on #. -⍝ Reported as bug <01355> to Dyalog on 2017-04-24. - ⎕IO←0 ⋄ ⎕ML←3 - startIn←{0<⎕NC ⍵:⍎⍵ ⋄ '#'}'startIn' - r←⍉1↓[1]⎕SE.UCMD'locate ',what,' -return=count -objects=',⍕startIn - :If 0<1↑⍴r←(0'#'+.=⍵:⍵ ⋄ {⌽⍵↑⍨1+⍵⍳'#'}⌽⍵}¨r[;0] ⍝ Circumvent bug <01356> - :EndIf diff --git a/APLSource/TestCases-11/G-1.aplf b/APLSource/TestCases-11/G-1.aplf deleted file mode 100644 index 77ffdd9..0000000 --- a/APLSource/TestCases-11/G-1.aplf +++ /dev/null @@ -1,8 +0,0 @@ - r←G;⎕IO -⍝ Prints all groups to the session. - ⎕IO←0 - r←↓'Test_'{⍵⌿⍨((⍴⍺)↑[1]⍵)∧.=⍺}'T'⎕NL 3 - :If ~0∊⍴r←(2='_'+.=⍉{⎕ML←1 ⋄ ↑⍵}r)⌿r - :AndIf ~0∊⍴r←{⎕ML←1 ⋄ ↑⍵}∪{⍵↑⍨⍵⍳'_'}¨{⍵↓⍨1+⍵⍳'_'}¨r - r←r[⍋#.APLTreeUtils.Lowercase r;] - :EndIf diff --git a/APLSource/TestCases-11/GetFileRoot-89.aplf b/APLSource/TestCases-11/GetFileRoot-89.aplf deleted file mode 100644 index 8234ba9..0000000 --- a/APLSource/TestCases-11/GetFileRoot-89.aplf +++ /dev/null @@ -1,2 +0,0 @@ - r←GetFileRoot - r←#.FilesAndDirs.PWD,'\' diff --git a/APLSource/TestCases-11/GetTestCasesHome-1089.aplf b/APLSource/TestCases-11/GetTestCasesHome-1089.aplf deleted file mode 100644 index 89a9a70..0000000 --- a/APLSource/TestCases-11/GetTestCasesHome-1089.aplf +++ /dev/null @@ -1,2 +0,0 @@ - r←GetTestCasesHome - r←#.FilesAndDirs.GetTempPath,'WinSys_Testcases\' diff --git a/APLSource/TestCases-11/GoToTidyUp-115.aplf b/APLSource/TestCases-11/GoToTidyUp-115.aplf deleted file mode 100644 index afc410d..0000000 --- a/APLSource/TestCases-11/GoToTidyUp-115.aplf +++ /dev/null @@ -1,10 +0,0 @@ - r←{label}GoToTidyUp flag -⍝ Returns either an empty vector or "Label" which defaults to ∆TidyUp -⍝ but signals 999 when flag=1 and "stopFlag" exists and is 1. - :If 1=flag - :AndIf 0<⎕NC'stopFlag' - :AndIf stopFlag - ⎕SIGNAL 999 - :EndIf - label←{(0<⎕NC ⍵):⍎⍵ ⋄ r←⍎'∆TidyUp'}'label' - r←flag/label diff --git a/APLSource/TestCases-11/Initial-1.aplf b/APLSource/TestCases-11/Initial-1.aplf deleted file mode 100644 index dc95e87..0000000 --- a/APLSource/TestCases-11/Initial-1.aplf +++ /dev/null @@ -1,9 +0,0 @@ - Initial;home - ⎕IO←0 ⋄ ⎕ML←3 - #.FilesAndDirs.PolishCurrentDir - #.Tester.EstablishHelpersIn ⍬ - #.INI←'flat'(⎕NEW #.IniFiles(,⊂GetFileRoot,'Tests\INIs\TestCases_',##.WinSys.GetComputerName,'.ini')).Convert ⎕NS'' - home←GetTestCasesHome - {}#.FilesAndDirs.RmDir home ⍝ Just in case - {}'Create!'#.FilesAndDirs.CheckPath home ⍝ Create the directory; is populated by some test cases -⍝Done diff --git a/APLSource/TestCases-11/L-1.aplf b/APLSource/TestCases-11/L-1.aplf deleted file mode 100644 index 98607c3..0000000 --- a/APLSource/TestCases-11/L-1.aplf +++ /dev/null @@ -1,17 +0,0 @@ - r←{numbers}L group -⍝ Prints a list with all test cases and the first comment line to the session. -⍝ If "group" is not empty then it will print only that group (case independent). -⍝ May or may not start with "Test_" -⍝ If "numbers" is defined only those number are printed. - numbers←{(0<⎕NC ⍵):⍎⍵ ⋄ ⍬}'numbers' - r←↓'Test_'{⍵⌿⍨((⍴⍺)↑[1+⎕IO]⍵)∧.=⍺}'T'⎕NL 3 - :If ~0∊⍴group - group←#.APLTreeUtils.Lowercase'test_'{((⍺≢(⍴⍺)↑⍵)/⍺),⍵}group - r←(({⎕ML←1 ⋄ ↑⍵}#.APLTreeUtils.Lowercase(⍴group)↑¨r)∧.=group)⌿r - :EndIf - :If ~0∊⍴r - :AndIf ~0∊⍴numbers - r←(({⍎⍵↑⍨-(-⎕IO)+'_'⍳⍨⌽⍵}¨r)∊numbers)⌿r - :EndIf - r←r,⍪{⎕ML←3 ⋄ {⍵↓⍨+/∧\' '=⍵}{⎕IO←1 ⋄ ⍵↓⍨⍵⍳'⍝'}∊1↑1↓⎕NR ⍵}¨r - r←r[⍋{⎕ML←1 ⋄ ↑⍵}##.APLTreeUtils.Lowercase r[;⎕IO];] diff --git a/APLSource/TestCases-11/ListHelpers-11.aplf b/APLSource/TestCases-11/ListHelpers-11.aplf deleted file mode 100644 index dd44e24..0000000 --- a/APLSource/TestCases-11/ListHelpers-11.aplf +++ /dev/null @@ -1,18 +0,0 @@ - r←ListHelpers force;list;⎕IO;⎕ML;force -⍝ Lists all helpers available from the `Tester` class. -⍝ When called by a user pass a `0` as right argument to see all helpers that are actually available. -⍝ Specify a `1` in case you want to see all Helpers that **might** be available. -⍝ Helpers are usually established by calling the `EstablishHelpers' method. -⍝ The list includes helpers that won't be established in case the namespace hosting the test cases is scripted! - ⎕IO←1 ⋄ ⎕ML←1 - force←⎕THIS≡⊃(1↓⎕RSI),⊂'' - r←0 2⍴' ' - list←'Run' 'RunDebug' 'RunThese' 'RunBatchTests' 'RunBatchTestsInDebugMode' 'E' 'L' 'G' 'FailsIf' 'PassesIf' - list,←'GoToTidyUp' 'RenameTestFnsTo' 'ListHelpers' '∆OK' '∆Failed' '∆NoBatchTest' '∆Inactive' '∆NoAcreTests' - list,←'∆WindowsOnly' '∆LinuxOnly' '∆MacOnly' '∆LinuxOrMacOnly' '∆LinuxOrWindowsOnly' - list,←'∆MacOrWindowsOnly' 'FindSpecialString' - list←,¨list - :If 'Tester.Helpers'≢{⍵↑⍨-+/∧\2>+\⌽'.'=⍵}⍕⊃⎕RSI - list/⍨←force∨0<⊃∘⎕NC¨list ⍝ List only those that are around - :EndIf - r←↑{⍵(#.APLTreeUtils.dlb{⍺⍺{⍵↓⍨¯1+⍵⍳'⍝'}⍺⍺ ⍵}1⊃(1↓⎕NR ⍵),⊂'')}¨list diff --git a/APLSource/TestCases-11/PassesIf-41.aplf b/APLSource/TestCases-11/PassesIf-41.aplf deleted file mode 100644 index 25aaefd..0000000 --- a/APLSource/TestCases-11/PassesIf-41.aplf +++ /dev/null @@ -1,7 +0,0 @@ - PassesIf←{ -⍝ Usage : →PassesIf x, where x is a boolean scalar - ⍵:⍬ ⍝ Passes test, so →PassesIf x just continues - 0=⎕NC'stopFlag':0 ⍝ Stop not defined, continue with test suite - ~stopFlag:0 ⍝ Do not stop, continue with test suite - ⎕SIGNAL 999 ⍝ Otherwise stop for investigation - } diff --git a/APLSource/TestCases-11/RenameTestFnsTo-2441.aplf b/APLSource/TestCases-11/RenameTestFnsTo-2441.aplf deleted file mode 100644 index d2aa926..0000000 --- a/APLSource/TestCases-11/RenameTestFnsTo-2441.aplf +++ /dev/null @@ -1,99 +0,0 @@ - {r}←oldName RenameTestFnsTo newName;⎕IO;body;rc;⎕ML;header;comment;res;name;right;left;newParent;oldParent;delFilanme -⍝ Renames a test function and tells acre. -⍝ r ← ⍬ - ⎕IO←0 ⋄ ⎕ML←3 - r←⍬ - (oldName newName)←oldName newName~¨' ' - :If '.'∊oldName - (oldParent oldName)←¯1 0↓¨'.'#.APLTreeUtils.SplitPath oldName - oldParent←⍎oldParent - :Else - oldParent←↑⎕RSI - :EndIf - :If '.'∊newName - (newParent newName)←¯1 0↓¨'.'#.APLTreeUtils.SplitPath newName - newParent←⍎newParent - :Else - newParent←↑⎕RSI - :EndIf - ⎕SIGNAL 11/⍨oldParent≢newParent - 'Function to be renamed not found'⎕SIGNAL 11/⍨3≠oldParent.⎕NC oldName - 'New name is already used'⎕SIGNAL 11/⍨00+.≠↑∘⍴¨ms ⍝ There are at least 400 error messages defined... + →T.FailsIf 400>0+.≠↑∘⍴¨ms ⍝ There are at least 400 error messages defined... - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_008-1.aplf b/APLSource/TestCases/Test_008.aplf similarity index 61% rename from APLSource/TestCases-11/Test_008-1.aplf rename to APLSource/TestCases/Test_008.aplf index b32a85c..efb4452 100644 --- a/APLSource/TestCases-11/Test_008-1.aplf +++ b/APLSource/TestCases/Test_008.aplf @@ -1,14 +1,14 @@ R←Test_008(stopFlag batchFlag);h;ff;⎕TRAP ⍝ Exercise `##.WinSys.GetHandleFromCaption` - R←∆Failed + R←T._Failed ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') 'ff'⎕WC'Form'('Visible' 0)('Caption'(⎕A,⎕D,⎕A,⎕A)) h←##.WinSys.GetHandleFromCaption(⎕A,⎕D,⎕A,⎕A) - →FailsIf 0=h ⍝ That's the form we just created, so the handle must be valid + →T.FailsIf 0=h ⍝ That's the form we just created, so the handle must be valid ⎕EX'ff' ⎕DL 0.1 h←##.WinSys.GetHandleFromCaption(⎕A,⎕D,⎕A,⎕A) - →FailsIf 0≠h ⍝ The form has ceased to exist, so... + →T.FailsIf 0≠h ⍝ The form has ceased to exist, so... - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_009-1.aplf b/APLSource/TestCases/Test_009.aplf similarity index 72% rename from APLSource/TestCases-11/Test_009-1.aplf rename to APLSource/TestCases/Test_009.aplf index 8977815..2ba1574 100644 --- a/APLSource/TestCases-11/Test_009-1.aplf +++ b/APLSource/TestCases/Test_009.aplf @@ -1,9 +1,9 @@ R←Test_009(stopFlag batchFlag);dpi;⎕TRAP ⍝ Exercise `##.WinSys.GetDPI` - R←∆Failed + R←T._Failed ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') dpi←##.WinSys.GetDPI - →PassesIf(dpi>0)∧(501>dpi) + →T.PassesIf(dpi>0)∧(501>dpi) - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_010-1.aplf b/APLSource/TestCases/Test_010.aplf similarity index 75% rename from APLSource/TestCases-11/Test_010-1.aplf rename to APLSource/TestCases/Test_010.aplf index c2f9ac3..3a2b6b8 100644 --- a/APLSource/TestCases-11/Test_010-1.aplf +++ b/APLSource/TestCases/Test_010.aplf @@ -1,9 +1,9 @@ R←Test_010(stopFlag batchFlag);buf;⎕TRAP ⍝ Exercise `##.WinSys.GetDPI` - R←∆Failed + R←T._Failed ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') buf←##.WinSys.Version - →FailsIf 3≠⍴buf + →T.FailsIf 3≠⍴buf - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_012-1.aplf b/APLSource/TestCases/Test_012.aplf similarity index 70% rename from APLSource/TestCases-11/Test_012-1.aplf rename to APLSource/TestCases/Test_012.aplf index 8c4ddbc..3c02e32 100644 --- a/APLSource/TestCases-11/Test_012-1.aplf +++ b/APLSource/TestCases/Test_012.aplf @@ -1,10 +1,10 @@ R←Test_012(stopFlag batchFlag);⎕TRAP;r ⍝ Exercise `##.WinSys.GetSystemParametersInfo` ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed r←##.WinSys.GetSystemParametersInfo - →FailsIf 2≠⍴r - →FailsIf 15≠⍴1⊃r + →T.FailsIf 2≠⍴r + →T.FailsIf 15≠⍴1⊃r - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_013-1.aplf b/APLSource/TestCases/Test_013.aplf similarity index 62% rename from APLSource/TestCases-11/Test_013-1.aplf rename to APLSource/TestCases/Test_013.aplf index 822f951..838f9c6 100644 --- a/APLSource/TestCases-11/Test_013-1.aplf +++ b/APLSource/TestCases/Test_013.aplf @@ -1,10 +1,10 @@ R←Test_013(stopFlag batchFlag);⎕TRAP;r ⍝ Exercise `##.WinSys.GetFormCaptionFontInfo` ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed r←##.WinSys.GetFormCaptionFontInfo - →FailsIf 14≠⍴r - →FailsIf' '≠1↑0⍴13⊃r ⍝ Is it a font's name? + →T.FailsIf 14≠⍴r + →T.FailsIf' '≠1↑0⍴13⊃r ⍝ Is it a font's name? - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_014-1.aplf b/APLSource/TestCases/Test_014.aplf similarity index 54% rename from APLSource/TestCases-11/Test_014-1.aplf rename to APLSource/TestCases/Test_014.aplf index d01c6e6..85450d2 100644 --- a/APLSource/TestCases-11/Test_014-1.aplf +++ b/APLSource/TestCases/Test_014.aplf @@ -1,10 +1,10 @@ R←Test_014(stopFlag batchFlag);⎕TRAP;r;path;exeName;parms;dllName ⍝ Exercise `##.WinSys.GetModuleFileName` ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed - dllName←↑↑#.FilesAndDirs.Dir(⎕IO⊃#.APLTreeUtils.SplitPath ⎕IO ⎕IO⊃#.GetCommandLineArgs'Dyalog'),'\dyalog*.dll' + dllName←↑↑##.FilesAndDirs.Dir(⎕IO⊃##.APLTreeUtils.SplitPath ⎕IO ⎕IO⊃#.GetCommandLineArgs'Dyalog'),'\dyalog*.dll' r←##.WinSys.GetModuleFileName dllName - →PassesIf 0<⍴r + →T.PassesIf 0<⍴r - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_015-1.aplf b/APLSource/TestCases/Test_015.aplf similarity index 66% rename from APLSource/TestCases-11/Test_015-1.aplf rename to APLSource/TestCases/Test_015.aplf index ed27273..a70850c 100644 --- a/APLSource/TestCases-11/Test_015-1.aplf +++ b/APLSource/TestCases/Test_015.aplf @@ -1,8 +1,8 @@ R←Test_015(stopFlag batchFlag);⎕TRAP;r;dllName ⍝ Exercise `##.WinSys.IsRunningAsAdmin` ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed - →PassesIf(##.WinSys.IsRunningAsAdmin)∊0 1 + →T.PassesIf(##.WinSys.IsRunningAsAdmin)∊0 1 - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_016-1.aplf b/APLSource/TestCases/Test_016.aplf similarity index 58% rename from APLSource/TestCases-11/Test_016-1.aplf rename to APLSource/TestCases/Test_016.aplf index 11a841d..47d6bb2 100644 --- a/APLSource/TestCases-11/Test_016-1.aplf +++ b/APLSource/TestCases/Test_016.aplf @@ -1,16 +1,16 @@ R←Test_016(stopFlag batchFlag);⎕TRAP;r;dllName;filename;path;rc ⍝ Exercise `##.WinSys.FindExecutable` ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed :If 0=batchFlag filename←'Tests\empty.dws' :If 0=⎕NEXISTS filename . ⍝ Huuh?! Something is wrong here! :EndIf - (rc path)←##.WinSys.FindExecutable #.FilesAndDirs.PWD,'\',filename - →FailsIf 0≠rc - →FailsIf'dyalog.exe'≢#.APLTreeUtils.Lowercase 1⊃#.APLTreeUtils.SplitPath path + (rc path)←##.WinSys.FindExecutable ##.FilesAndDirs.PWD,'\',filename + →T.FailsIf 0≠rc + →T.FailsIf'dyalog.exe'≢##.APLTreeUtils.Lowercase 1⊃##.APLTreeUtils.SplitPath path :EndIf - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_017-1.aplf b/APLSource/TestCases/Test_017.aplf similarity index 86% rename from APLSource/TestCases-11/Test_017-1.aplf rename to APLSource/TestCases/Test_017.aplf index 729fdd9..f5a4c4e 100644 --- a/APLSource/TestCases-11/Test_017-1.aplf +++ b/APLSource/TestCases/Test_017.aplf @@ -1,8 +1,8 @@ R←Test_017(stopFlag batchFlag);⎕TRAP ⍝ Exercise `##.WinSys.GetLastError` ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed {}##.WinSys.GetLastError - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_018-1.aplf b/APLSource/TestCases/Test_018.aplf similarity index 69% rename from APLSource/TestCases-11/Test_018-1.aplf rename to APLSource/TestCases/Test_018.aplf index 29a67d2..53049bd 100644 --- a/APLSource/TestCases-11/Test_018-1.aplf +++ b/APLSource/TestCases/Test_018.aplf @@ -1,7 +1,7 @@ R←Test_018(stopFlag batchFlag);⎕TRAP;cmd;fn;pid;home ⍝ Exercise `##.WinSys.KillProcess` Deprecated! ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed home←GetFileRoot 1 ⎕NDELETE fn←home,'Tests\TestKillProcessId' @@ -9,9 +9,9 @@ cmd,←' "',home,'Tests\TestKillProcess"' ⎕SH cmd'' ⎕DL 2 - pid←⍎#.APLTreeUtils.ReadUtf8File fn + pid←⍎##.APLTreeUtils.ReadUtf8File fn - →PassesIf ##.WinSys.KillProcess pid - →PassesIf 0=##.WinSys.KillProcess 0 + →T.PassesIf ##.WinSys.KillProcess pid + →T.PassesIf 0=##.WinSys.KillProcess 0 - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_019-1.aplf b/APLSource/TestCases/Test_019.aplf similarity index 67% rename from APLSource/TestCases-11/Test_019-1.aplf rename to APLSource/TestCases/Test_019.aplf index 1278683..18df7be 100644 --- a/APLSource/TestCases-11/Test_019-1.aplf +++ b/APLSource/TestCases/Test_019.aplf @@ -1,10 +1,10 @@ R←Test_019(stopFlag batchFlag);⎕TRAP;parms ⍝ Exercise `##.WinSys.CreateParms_ShellExecute` ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed parms←##.WinSys.CreateParms_ShellExecute - →FailsIf 9≠⎕NC'parms' - →FailsIf 0∊⍴parms.⎕NL⍳16 + →T.FailsIf 9≠⎕NC'parms' + →T.FailsIf 0∊⍴parms.⎕NL⍳16 - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_024-1.aplf b/APLSource/TestCases/Test_024.aplf similarity index 69% rename from APLSource/TestCases-11/Test_024-1.aplf rename to APLSource/TestCases/Test_024.aplf index d024164..9dc633b 100644 --- a/APLSource/TestCases-11/Test_024-1.aplf +++ b/APLSource/TestCases/Test_024.aplf @@ -1,7 +1,7 @@ R←Test_024(stopFlag batchFlag);⎕TRAP;ref;∆;size;posn ⍝ Exercise `##.WinSys.SetWindowParms` ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed ∆←'' ∆,←⊂'Caption' 'WinSys-TestCases-024' @@ -18,14 +18,14 @@ size←400 600 {}##.WinSys.SetWindowParms ref.Handle size - →GoToTidyUp~∧/(⌊(##.WinSys.GetDPI÷100)×⌽ref.Size)∊¨(size-20)+¨⊂⍳40 + →T.GoToTidyUp~∧/(⌊(##.WinSys.GetDPI÷100)×⌽ref.Size)∊¨(size-20)+¨⊂⍳40 size←500 800 posn←100 200 {}posn ##.WinSys.SetWindowParms ref.Handle size - →GoToTidyUp~∧/(⌊(##.WinSys.GetDPI÷100)×⌽ref.Size)∊¨(size-20)+¨⊂⍳40 - →GoToTidyUp~∧/(⌊(##.WinSys.GetDPI÷100)×⌽ref.Posn)∊¨(posn-20)+¨⊂⍳40 + →T.GoToTidyUp~∧/(⌊(##.WinSys.GetDPI÷100)×⌽ref.Size)∊¨(size-20)+¨⊂⍳40 + →T.GoToTidyUp~∧/(⌊(##.WinSys.GetDPI÷100)×⌽ref.Posn)∊¨(posn-20)+¨⊂⍳40 - R←∆OK + R←T._OK ∆TidyUp: :Trap 0 ⋄ {}ref.Close ⋄ :EndTrap diff --git a/APLSource/TestCases-11/Test_025-1.aplf b/APLSource/TestCases/Test_025.aplf similarity index 59% rename from APLSource/TestCases-11/Test_025-1.aplf rename to APLSource/TestCases/Test_025.aplf index 21791a5..920a06a 100644 --- a/APLSource/TestCases-11/Test_025-1.aplf +++ b/APLSource/TestCases/Test_025.aplf @@ -1,14 +1,14 @@ R←Test_025(stopFlag batchFlag);h;ff;⎕TRAP ⍝ Test the `##.WinSys.FindWindow` - R←∆Failed + R←T._Failed ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') 'ff'⎕WC'Form'('Visible' 0)('Caption'(⎕A,⎕D,⎕A,⎕A)) h←##.WinSys.FindWindow(⎕A,⎕D,⎕A,⎕A) - →FailsIf 0=h ⍝ That's the form we just created, so the handle must be valid + →T.FailsIf 0=h ⍝ That's the form we just created, so the handle must be valid ⎕EX'ff' ⎕DL 0.1 h←##.WinSys.FindWindow(⎕A,⎕D,⎕A,⎕A) - →FailsIf 0≠h ⍝ The form has ceased to exist, so... + →T.FailsIf 0≠h ⍝ The form has ceased to exist, so... - R←∆OK + R←T._OK diff --git a/APLSource/TestCases/Test_026.aplf b/APLSource/TestCases/Test_026.aplf new file mode 100644 index 0000000..be1fd99 --- /dev/null +++ b/APLSource/TestCases/Test_026.aplf @@ -0,0 +1,15 @@ + R←Test_026(stopFlag batchFlag);list;⎕TRAP + ⍝ Exercise `##.WinSys.GetAllDrives` + R←T._Failed + ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') + + +⍝ Tests... + list←##.WinSys.GetAllDrives + →T.FailsIf~0<⍴list + →T.FailsIf~∧/(↑¨list)∊⎕A + →T.FailsIf(,':')≢,∪1⊃¨list + →T.FailsIf(,'\')≢,∪2⊃¨list + →T.FailsIf(,3)≢∪↑∘⍴¨list + + R←T._OK diff --git a/APLSource/TestCases/Test_027.aplf b/APLSource/TestCases/Test_027.aplf new file mode 100644 index 0000000..4bcb9b7 --- /dev/null +++ b/APLSource/TestCases/Test_027.aplf @@ -0,0 +1,32 @@ + R←Test_027(stopFlag batchFlag);list;types;⎕TRAP + ⍝ Exercise `##.WinSys.GetDriveAndType` + R←T._Failed + ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') + + Match←{(∧/⍺∊⍵)∧(∧/⍵∊⍺)} + +⍝ Tests... + list←##.WinSys.GetDriveAndType + + →T.FailsIf~0<⍴list[;0] + →T.FailsIf~∧/(↑¨list[;0])∊⎕A + →T.FailsIf(,':')≢,∪1⊃¨list[;0] + →T.FailsIf(,'\')≢,∪2⊃¨list[;0] + →T.FailsIf(,3)≢∪↑∘⍴¨list[;0] + →T.FailsIf~∧/(∪list[;1])∊⍳9 + + ⍝ The following tests depend on local specialties - see "Initial" + :If 0≠≢#.INI.FixedDrives + →T.PassesIf(,#.INI.FixedDrives)Match↑¨(list[;2]≡¨⊂'Fixed')/list[;0] + :EndIf + :If 0≠≢#.INI.NetworkDrives + →T.PassesIf(,#.INI.NetworkDrives)Match↑¨(list[;2]≡¨⊂'Remote')/list[;0] + :EndIf + :If 0≠≢#.INI.CDRomDrives + →T.PassesIf(,#.INI.CDRomDrives)Match↑¨(list[;2]≡¨⊂'CD-ROM')/list[;0] + :EndIf + + types←'Invalid Path' 'Removable' 'Fixed' 'Remote' 'CD-ROM' 'Ram-Disk' + →T.FailsIf~∧/(∪list[;2])∊types + + R←T._OK diff --git a/APLSource/TestCases-11/Test_028-1.aplf b/APLSource/TestCases/Test_028.aplf similarity index 64% rename from APLSource/TestCases-11/Test_028-1.aplf rename to APLSource/TestCases/Test_028.aplf index 3caf07a..8cbfd2d 100644 --- a/APLSource/TestCases-11/Test_028-1.aplf +++ b/APLSource/TestCases/Test_028.aplf @@ -1,8 +1,8 @@ R←Test_028(stopFlag batchFlag);⎕TRAP;exe ⍝ Exercise `##.WinSys.GetDefaultBrowser` - R←∆Failed + R←T._Failed ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - →PassesIf 0<≢exe←##.WinSys.GetDefaultBrowser + →T.PassesIf 0<≢exe←##.WinSys.GetDefaultBrowser - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_ShellExec_002-421.aplf b/APLSource/TestCases/Test_ShellExec_002.aplf similarity index 83% rename from APLSource/TestCases-11/Test_ShellExec_002-421.aplf rename to APLSource/TestCases/Test_ShellExec_002.aplf index 4cb7c5f..a76976b 100644 --- a/APLSource/TestCases-11/Test_ShellExec_002-421.aplf +++ b/APLSource/TestCases/Test_ShellExec_002.aplf @@ -1,7 +1,7 @@ R←Test_ShellExec_002(stopFlag batchFlag);⎕TRAP;parms ⍝ Exercise `##.WinSys.ShellExecute` with a parameter space and an invalid verb ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed parms←##.WinSys.CreateParms_ShellExecute parms.file←↑#.GetCommandLineArgs @@ -9,7 +9,7 @@ :Trap 0 ##.WinSys.ShellExecute parms :Else - →PassesIf'Invalid verb'≡↑⎕DM + →T.PassesIf'Invalid verb'≡↑⎕DM :EndTrap - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Test_ShellExec_003-421.aplf b/APLSource/TestCases/Test_ShellExec_003.aplf similarity index 75% rename from APLSource/TestCases-11/Test_ShellExec_003-421.aplf rename to APLSource/TestCases/Test_ShellExec_003.aplf index 9b87f50..a0d2468 100644 --- a/APLSource/TestCases-11/Test_ShellExec_003-421.aplf +++ b/APLSource/TestCases/Test_ShellExec_003.aplf @@ -1,12 +1,12 @@ R←Test_ShellExec_003(stopFlag batchFlag);⎕TRAP ⍝ Exercise `##.WinSys.ShellExecute` with an invalid right argument ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed :Trap 0 ##.WinSys.ShellExecute'one' 'two' :Else - →PassesIf'Invalid right argument'≡↑⎕DM + →T.PassesIf'Invalid right argument'≡↑⎕DM :EndTrap - R←∆OK + R←T._OK diff --git a/APLSource/TestCases/Test_ShellExec_004.aplf b/APLSource/TestCases/Test_ShellExec_004.aplf new file mode 100644 index 0000000..cba3d2a --- /dev/null +++ b/APLSource/TestCases/Test_ShellExec_004.aplf @@ -0,0 +1,16 @@ + R←Test_ShellExec_004(stopFlag batchFlag);⎕TRAP;tfn;wspath;pid;filename;exe +⍝ Exercise `##.WinSys.ShellExecute` with a string as right argument. + ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') + R←T._Failed + + wspath←'"',##.FilesAndDirs.PWD,'\Tests\TestCase_ShellExec_004.dws"' + exe←(2 ⎕NQ'#' 'GetEnvironment' 'Dyalog'),'/dyalog.exe' + pid←⍕##.WinSys.GetProcessID + →T.PassesIf 0=##.WinSys.ShellExecute'"',exe,'" ',wspath,' pid=',pid ⍝ ,' -lx' ⍝ For chaning that WS + ⎕DL 2 + filename←##.FilesAndDirs.PWD,'\Tests\TestCase_ShellExec_004-',pid + →T.PassesIf ⎕NEXISTS filename + →T.PassesIf'Here we are!'≡##.APLTreeUtils.ReadUtf8File filename + ⎕NDELETE filename + + R←T._OK diff --git a/APLSource/TestCases-11/Test_ShellExec_005-421.aplf b/APLSource/TestCases/Test_ShellExec_005.aplf similarity index 56% rename from APLSource/TestCases-11/Test_ShellExec_005-421.aplf rename to APLSource/TestCases/Test_ShellExec_005.aplf index a1adc97..82f5e9a 100644 --- a/APLSource/TestCases-11/Test_ShellExec_005-421.aplf +++ b/APLSource/TestCases/Test_ShellExec_005.aplf @@ -1,15 +1,15 @@ R←Test_ShellExec_005(stopFlag batchFlag);⎕TRAP;tfn;buffer ⍝ Exercise `##.WinSys.ShellExecute` with a more complex string as right argument. ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed - tfn←#.FilesAndDirs.GetTempFilename'' - →GoToTidyUp 0≠##.WinSys.ShellExecute'cmd.exe /C Dir >',tfn + tfn←##.FilesAndDirs.GetTempFilename'' + →T.GoToTidyUp 0≠##.WinSys.ShellExecute'cmd.exe /C Dir >',tfn ⎕DL 0.2 - buffer←#.APLTreeUtils.ReadUtf8File tfn - →GoToTidyUp 0∊⍴buffer + buffer←##.APLTreeUtils.ReadUtf8File tfn + →T.GoToTidyUp 0∊⍴buffer - R←∆OK + R←T._OK ∆TidyUp: :Trap 0 ⋄ ⎕NDELETE tfn ⋄ :EndTrap diff --git a/APLSource/TestCases-11/Test_ShellExec_020-421.aplf b/APLSource/TestCases/Test_ShellExec_020.aplf similarity index 69% rename from APLSource/TestCases-11/Test_ShellExec_020-421.aplf rename to APLSource/TestCases/Test_ShellExec_020.aplf index b2afcca..53dea5d 100644 --- a/APLSource/TestCases-11/Test_ShellExec_020-421.aplf +++ b/APLSource/TestCases/Test_ShellExec_020.aplf @@ -2,41 +2,41 @@ ⍝ Exercise `##.WinSys.ShellExecute` with a parameter space. ⍝ NOTE: This test case can only succeed when the account under which it is executed has admin rights. ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed Wait←{_←⎕DL 0.1 ⋄ ⎕NEXISTS ⍵:{_←⎕DL ⍵ ⋄ 1:}0.2 ⋄ ∇ ⍵} pid←##.WinSys.GetProcessID parms←##.WinSys.CreateParms_ShellExecute parms.file←↑#.GetCommandLineArgs - parms.lpParms←#.FilesAndDirs.PWD,'\Tests\TestCase_ShellExec_020' + parms.lpParms←##.FilesAndDirs.PWD,'\Tests\TestCase_ShellExec_020' parms.lpParms,←' pid=',⍕pid ⍝parms.lpParms,←' -lx' ⍝ For testing/changing that WS only ⍝parms.lpParms,←' Captions\Session="',(⍕pid),' {WSID}"' ⍝ For testing/changing that WS only - filename←#.FilesAndDirs.PWD,'\Tests\TestCase_ShellExec_020-',⍕pid - →GoToTidyUp 0≠##.WinSys.ShellExecute parms + filename←##.FilesAndDirs.PWD,'\Tests\TestCase_ShellExec_020-',⍕pid + →T.GoToTidyUp 0≠##.WinSys.ShellExecute parms Wait filename - →GoToTidyUp 0≠⍎#.APLTreeUtils.ReadUtf8File filename + →T.GoToTidyUp 0≠⍎##.APLTreeUtils.ReadUtf8File filename ⎕DL 0.2 ⎕NDELETE filename ⎕DL 0.2 ⍝ Same as before but via the left argument of `ShellExecute` we grant admin rights: - →GoToTidyUp 0≠1 ##.WinSys.ShellExecute parms + →T.GoToTidyUp 0≠1 ##.WinSys.ShellExecute parms Wait filename - →GoToTidyUp 1≠⍎#.APLTreeUtils.ReadUtf8File filename + →T.GoToTidyUp 1≠⍎##.APLTreeUtils.ReadUtf8File filename ⎕DL 0.2 ⎕NDELETE filename ⎕DL 0.2 ⍝ Almost the same as before but we grant admin rights via the verb: "RunAs" implies admin rights. parms.verb←'RUNAS' - →GoToTidyUp 0≠##.WinSys.ShellExecute parms + →T.GoToTidyUp 0≠##.WinSys.ShellExecute parms ⎕DL 2 ⍝ Wait filename - →GoToTidyUp 1≠⍎#.APLTreeUtils.ReadUtf8File filename + →T.GoToTidyUp 1≠⍎##.APLTreeUtils.ReadUtf8File filename ⎕DL 0.1 - R←∆OK + R←T._OK ∆TidyUp: :If 0<⎕NC'filename' diff --git a/APLSource/TestCases-11/Test_ZZZ_998-e1.aplf b/APLSource/TestCases/Test_ZZZ_998.aplf similarity index 70% rename from APLSource/TestCases-11/Test_ZZZ_998-e1.aplf rename to APLSource/TestCases/Test_ZZZ_998.aplf index b4ac6d8..ac90042 100644 --- a/APLSource/TestCases-11/Test_ZZZ_998-e1.aplf +++ b/APLSource/TestCases/Test_ZZZ_998.aplf @@ -1,27 +1,21 @@ - R←Test_ZZZ_998(stopFlag batchFlag);⎕IO;⎕ML;⎕TRAP;report;buff;xml;source + R←Test_ZZZ_998(stopFlag batchFlag);⎕IO;⎕ML;⎕TRAP;report;buff ⍝ Checks on two text vectors: "⍝TODO⍝" and "⍝CHECK⍝"; never fails, just reports. ⎕IO←0 ⋄ ⎕ML←3 ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆OK - + R←T._OK report←'' - xml←⎕XML'flat'#.APLTreeUtils.ReadUtf8File'publish.config' - source←2⊃xml[xml[;1]⍳⊂'container';] - - buff←source FindSpecialString'⍝CHECK⍝' + buff←T.FindSpecialString'⍝CHECK⍝' buff←(buff[;0]≢¨⎕XSI[0])⌿buff ⍝ remove caller - :If ~0∊⍴buff + :If 0≠≢buff report,←↓(⊂' ⍝CHECK⍝ found:'),(⊂' '),¨buff :EndIf - - buff←source FindSpecialString'⍝TODO⍝' + buff←T.FindSpecialString'⍝TODO⍝' buff←(buff[;0]≢¨⎕XSI[0])⌿buff ⍝ remove caller - :If ~0∊⍴buff + :If 0≠≢buff report,←↓(⊂' ⍝TODO⍝ found:'),(⊂' '),¨buff :EndIf - - :If 1=⍴,report + :If 1=≢report report,←⊂' Nothing found!' :Else ⎕←'Checking for ⍝TODO⍝ and ⍝CHECK⍝ '{⍵↑,'--- ',⍺,' ',⍵⍴'-'}80⌊⎕PW-1 diff --git a/APLSource/TestCases-11/Test_ZZZ_999-e1.aplf b/APLSource/TestCases/Test_ZZZ_999.aplf similarity index 85% rename from APLSource/TestCases-11/Test_ZZZ_999-e1.aplf rename to APLSource/TestCases/Test_ZZZ_999.aplf index feb7280..d0e8b48 100644 --- a/APLSource/TestCases-11/Test_ZZZ_999-e1.aplf +++ b/APLSource/TestCases/Test_ZZZ_999.aplf @@ -1,9 +1,9 @@ R←Test_ZZZ_999(stopFlag batchFlag);v;n;d;xml;rf;f1;f2;⎕TRAP ⍝ Check the "Version" function and publish.config. ⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N') - R←∆Failed + R←T._Failed - rf←#._WinSys.WinSys + rf←#.WinSys.WinSys ⍝ First we check whether "Version" returns a valid result: (n v d)←rf.Version @@ -17,7 +17,7 @@ f1∨←~∧/⎕D∊⍨d~'-' ⍝ publish.config must be in line with what "Version" returns of course: - xml←⎕XML'flat'#.APLTreeUtils.ReadUtf8File'publish.config' + xml←⎕XML'flat'##.APLTreeUtils.ReadUtf8File'publish.config' f2←v≢(2+⎕IO)⊃xml[xml[;1+⎕IO]⍳⊂'version';] f2∨←d≢(2+⎕IO)⊃xml[xml[;1+⎕IO]⍳⊂'date';] @@ -28,6 +28,6 @@ ⎕←'The contents of "publish.config" is not in line with "Version".' :EndIf - →FailsIf f1∨f2 + →T.FailsIf f1∨f2 - R←∆OK + R←T._OK diff --git a/APLSource/TestCases-11/Version-1.aplf b/APLSource/TestCases/Version.aplf similarity index 100% rename from APLSource/TestCases-11/Version-1.aplf rename to APLSource/TestCases/Version.aplf diff --git a/APLSource/TestCases-11/Wait-1.aplf b/APLSource/TestCases/Wait.aplf similarity index 100% rename from APLSource/TestCases-11/Wait-1.aplf rename to APLSource/TestCases/Wait.aplf diff --git "a/APLSource/TestCases-11/\342\210\206Ask-2.aplf" "b/APLSource/TestCases/\342\210\206Ask.aplf" similarity index 100% rename from "APLSource/TestCases-11/\342\210\206Ask-2.aplf" rename to "APLSource/TestCases/\342\210\206Ask.aplf" diff --git a/APLSource/WinSys-9.aplc b/APLSource/WinSys.aplc similarity index 99% rename from APLSource/WinSys-9.aplc rename to APLSource/WinSys.aplc index ebdb81f..e98d2ea 100644 --- a/APLSource/WinSys-9.aplc +++ b/APLSource/WinSys.aplc @@ -15,7 +15,7 @@ ∇ r←Version :Access Public shared - r←({⍵↑⍨-'.'⍳⍨⌽⍵}⍕⎕THIS)'2.8.0.5' '2019-06-04' + r←({⍵↑⍨-'.'⍳⍨⌽⍵}⍕⎕THIS)'2.8.0.6' '2019-06-04' ∇ ∇ History diff --git a/Make/Make.bat b/Make/Make.bat index d77a09b..19a4a4a 100644 --- a/Make/Make.bat +++ b/Make/Make.bat @@ -1,2 +1,2 @@ -"C:\Program Files\Dyalog\Dyalog APL-64 15.0 Unicode\dyalog.exe" %1 maxw=64000 %2 %3 %4 +"C:\Program Files\Dyalog\Dyalog APL-64 16.0 Unicode\dyalog.exe" %1 maxw=64000 %2 %3 %4 IF %ERRORLEVEL% NEQ 0 echo ERROR \ No newline at end of file diff --git a/Tests/TestKillProcessId b/Tests/TestKillProcessId index a44e61f..66ca854 100644 --- a/Tests/TestKillProcessId +++ b/Tests/TestKillProcessId @@ -1 +1 @@ -9032 \ No newline at end of file +13608 \ No newline at end of file diff --git a/acre.config b/acre.config index 48fe852..af8ba49 100644 --- a/acre.config +++ b/acre.config @@ -1 +1,6 @@ -[ CaseCode←'On' Open←'' ProjectSpace←'#._WinSys' StartUp←'' ] \ No newline at end of file +{ + "CaseCode": "Off", + "Open": "", + "ProjectSpace": "#.WinSys", + "StartUp": "" +} \ No newline at end of file diff --git a/project.dws b/project.dws new file mode 100644 index 0000000..1b35cb7 Binary files /dev/null and b/project.dws differ diff --git a/publish.config b/publish.config index 6b58c16..1101221 100644 --- a/publish.config +++ b/publish.config @@ -1 +1 @@ - 2.8.0 2019-06-04 #._WinSys WinSys 1 WinSys.dyalog 1 WinSys 1 5 \ No newline at end of file + 2.8.0 2019-06-04 #.WinSys 1 6 1 \ No newline at end of file