Skip to content

Commit b4af993

Browse files
committed
Tester2 introduced
1 parent 76daa84 commit b4af993

File tree

12 files changed

+49
-64
lines changed

12 files changed

+49
-64
lines changed

APLSource/EventCodes.aplc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
∇ r←Version
6464
:Access Public Shared
65-
r←({⍵}⍕⎕THIS)'1.4.0.13' '2019-11-06'
65+
r←({⍵}⍕⎕THIS)'1.4.0.14' '2019-11-06'
6666
6767

6868
∇ History

APLSource/TestCases/Prepare.aplf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Prepare
2+
T←⎕NEW ##.Tester2 ⎕THIS

APLSource/TestCases/Test_01.aplf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
R←Test_01(stopFlag batchFlag);⎕TRAP
22
⍝ Make sure the basics work
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
4-
R←∆Failed
4+
R←T._Failed
55

66
{}##.EventCodes.DEADLOCK
77

8-
R←∆OK
8+
R←T._OK

APLSource/TestCases/Test_02.aplf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
R←Test_02(stopFlag batchFlag);⎕TRAP
22
⍝ Make sure `GetName` works.
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
4-
R←∆Failed
4+
R←T._Failed
55

6-
→PassesIf'DEADLOCK'≡##.EventCodes.GetName ##.EventCodes.DEADLOCK
7-
→PassesIf'DEADLOCK' 'SYNTAX_ERROR'≡##.EventCodes.GetName ##.EventCodes.(DEADLOCK SYNTAX_ERROR)
8-
→PassesIf 0=≢##.EventCodes.GetName''
9-
→PassesIf 0=≢##.EventCodes.GetName ⍬
6+
T.PassesIf'DEADLOCK'≡##.EventCodes.GetName ##.EventCodes.DEADLOCK
7+
T.PassesIf'DEADLOCK' 'SYNTAX_ERROR'≡##.EventCodes.GetName ##.EventCodes.(DEADLOCK SYNTAX_ERROR)
8+
T.PassesIf 0=≢##.EventCodes.GetName''
9+
T.PassesIf 0=≢##.EventCodes.GetName ⍬
1010
:Trap 6
1111
{}##.EventCodes.GetName ¯2
1212
→FailsIf 1
1313
:Else
14-
→PassesIf'Unknown event number'≡⊃⎕DM
14+
T.PassesIf'Unknown event number'≡⊃⎕DM
1515
:EndTrap
1616

17-
R←∆OK
17+
R←T._OK

APLSource/TestCases/Test_03.aplf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
R←Test_03(stopFlag batchFlag);⎕TRAP;buffer
22
⍝ Make sure `List` works.
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
4-
R←∆Failed
4+
R←T._Failed
55

66
buffer←##.EventCodes.List'T'
7-
→PassesIf'T'∧.=⊃¨buffer[;1]
7+
T.PassesIf'T'∧.=⊃¨buffer[;1]
88
buffer←##.EventCodes.List''
9-
→PassesIf=/≢¨buffer(##.EventCodes.⎕NL ¯2)
9+
T.PassesIf=/≢¨buffer(##.EventCodes.⎕NL ¯2)
1010

11-
R←∆OK
11+
R←T._OK

APLSource/TestCases/Test_20.aplf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
R←Test_20(stopFlag batchFlag);⎕TRAP
22
⍝ Exercise the `History` method
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
4-
R←∆Failed
4+
R←T._Failed
55

66
:Trap 0
77
##.EventCodes.History
88
→FailsIf 1
99
:EndTrap
1010

11-
R←∆OK
11+
R←T._OK

APLSource/TestCases/Test_30.aplf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
R←Test_30(stopFlag batchFlag);⎕TRAP;errors;TEMP;html;list;version
22
⍝ Check whether we cover all documented codes according to the latest installed version
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
4-
R←∆Failed
4+
R←T._Failed
55

66
version←3⊃' '##.APLTreeUtils.Split GetHighestInstalledAPL ⍬
77
errors←∆GetErrorsFromHelpPage'http://help.dyalog.com/',version,'/Content/Language/System%20Functions/trap.htm'
88
list←##.EventCodes.List''
9-
→PassesIf∧/list[;2]∊errors[;1]
10-
→PassesIf∧/errors[;1]∊list[;2]
9+
T.PassesIf∧/list[;2]∊errors[;1]
10+
T.PassesIf∧/errors[;1]∊list[;2]
1111

12-
R←∆OK
12+
R←T._OK

APLSource/TestCases/Test_40.aplf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
R←Test_40(stopFlag batchFlag);⎕TRAP;dmx
22
⍝ Check the `QEM` method.
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
4-
R←∆Failed
4+
R←T._Failed
55

6-
→PassesIf ⍬≡##.EventCodes.QEM''
7-
→PassesIf''≡##.EventCodes.QEM ⍬
8-
→PassesIf 1≡##.EventCodes.QEM'WS_FULL'
9-
→PassesIf'WS_FULL'≡##.EventCodes.QEM 1
6+
T.PassesIf ⍬≡##.EventCodes.QEM''
7+
T.PassesIf''≡##.EventCodes.QEM ⍬
8+
T.PassesIf 1≡##.EventCodes.QEM'WS_FULL'
9+
T.PassesIf'WS_FULL'≡##.EventCodes.QEM 1
1010
:Trap 0
1111
{}##.EventCodes.QEM'Unknown'
1212
→FailsIf 1
1313
:Else
1414
dmx←⎕DMX
15-
→PassesIf'Unknown error message'≡⊃dmx.DM
15+
T.PassesIf'Unknown error message'≡⊃dmx.DM
1616
:EndTrap
1717

18-
R←∆OK
18+
R←T._OK

APLSource/TestCases/Test_ZZZ_998.aplf

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,25 @@
1-
R←Test_ZZZ_998(stopFlag batchFlag);⎕IO;⎕ML;⎕TRAP;xml;report;buff;row;source;Find
2-
⍝ Checks on two text vectors: "⍝TODO⍝" and "⍝CHECK⍝"; This test case never fails, it just reports findings to the session.
1+
R←Test_ZZZ_998(stopFlag batchFlag);⎕IO;⎕ML;⎕TRAP;report;buff;xml;source
2+
⍝ Checks on two text vectors: "⍝TODO⍝" and "⍝CHECK⍝"; never fails, just reports.
33
⎕IO←0 ⋄ ⎕ML←3
44
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
5-
R←∆OK
6-
Find←⎕SE.acre._code.UT.fi
7-
5+
R←T._OK
86
report←''
9-
report,←⊂'Checking '{⍵↑,'--- ',⍺,' ',⍵⍴'-'}80⌊⎕PW-1
10-
report,←⊂'*** Scan ',⍕⎕THIS
117

12-
buff←(⎕THIS Find'⍝CHECK⍝')~⊂(⍕⎕THIS),'.',↑⎕SI
8+
xml←⎕XML'flat'##.APLTreeUtils.ReadUtf8File'publish.config'
9+
source←2⊃xml[xml[;1]⍳⊂'container';]
10+
buff←T.FindSpecialString'⍝CHECK⍝'
11+
buff←(buff[;0]≢¨⎕XSI[0])⌿buff ⍝ remove caller
1312
:If ~0∊⍴buff
14-
report,←(⊂' ⍝CHECK⍝ found:'),(⊂' '),¨buff
13+
report,←(⊂' ⍝CHECK⍝ found:'),(⊂' '),¨buff
1514
:EndIf
16-
17-
buff←(⎕THIS Find'⍝TODO⍝')~⊂(⍕⎕THIS),'.',↑⎕SI
15+
buff←T.FindSpecialString'⍝TODO⍝'
16+
buff←(buff[;0]≢¨⎕XSI[0])⌿buff ⍝ remove caller
1817
:If ~0∊⍴buff
19-
report,←(⊂' ⍝TODO⍝ found:'),(⊂' '),¨buff
18+
report,←(⊂' ⍝TODO⍝ found:'),(⊂' '),¨buff
2019
:EndIf
21-
22-
xml←⎕XML'flat'##.APLTreeUtils.ReadUtf8File'publish.config'
23-
:If (↑⍴xml)>row←xml[;1]⍳⊂'main'
24-
source←2⊃xml[row;]
25-
report,←⊂'*** Scan ',source
26-
source←','#.APLTreeUtils.Split source
27-
source←{(('#.'≢2⍴⍵)/'#.'),⍵}¨source
28-
29-
buff←source Find'⍝CHECK⍝'
30-
:If ~0∊⍴buff
31-
report,←(⊂' ⍝CHECK⍝ found:'),(⊂' '),¨buff
32-
:EndIf
33-
34-
buff←source Find'⍝TODO⍝'
35-
:If ~0∊⍴buff
36-
report,←(⊂' ⍝TODO⍝ found:'),(⊂' '),¨buff
37-
:EndIf
38-
20+
:If 1=⍴,report
21+
report,←⊂' Nothing found!'
22+
:Else
23+
⎕←'Checking for ⍝TODO⍝ and ⍝CHECK⍝ '{⍵↑,'--- ',⍺,' ',⍵⍴'-'}80⌊⎕PW-1
24+
⎕←⊃report
3925
:EndIf
40-
41-
⎕←⍪report
42-
⍝Done

APLSource/TestCases/Test_ZZZ_999.aplf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
R←Test_ZZZ_999(stopFlag batchFlag);v;n;d;xml;rf;f1;f2;⎕TRAP
22
⍝ Check the "Version" function and publish.config.
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
4-
R←∆Failed
4+
R←T._Failed
55

66
rf←#.EventCodes.EventCodes
77

@@ -28,6 +28,6 @@
2828
⎕←'The contents of "publish.config" is not in line with "Version".'
2929
:EndIf
3030

31-
→FailsIf f1∨f2
31+
T.FailsIf f1∨f2
3232

33-
R←∆OK
33+
R←T._OK

0 commit comments

Comments
 (0)