Skip to content

Commit 3d3aa5e

Browse files
committed
Documntation corrected and test case bug fixed
⎕IO and ⎕ML were not set for test cases.
1 parent 4d84282 commit 3d3aa5e

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

APLSource/EventCodes-21.class

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:Class EventCodes
2-
⍝ This class carries all trappable event codes in Dyalog APL up to -- and including -- version 15.0.\\
2+
⍝ This class carries all trappable event codes in Dyalog APL up to -- and including -- version 17.0.\\
33
⍝ For transforming a number to the symbolic name see function `GetName`.
44

55
⎕IO←1 ⋄ ⎕ML←1
@@ -60,11 +60,13 @@
6060

6161
∇ r←Version
6262
:Access Public Shared
63-
r←({⍵}⍕⎕THIS)'1.2.0.5' '2018-02-19'
63+
r←({⍵}⍕⎕THIS)'1.2.1.7' '2018-10-22'
6464
6565

6666
∇ History
6767
:Access Public Shared
68+
⍝ * 1.2.1
69+
⍝ * Fix: documentation mentioned "up to 15.0" when it's actually up to and including 17.0
6870
⍝ * 1.2.0
6971
⍝ * First release after the conversion from the APL wiki to GitHub.
7072
⍝ * 1.1.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Initial
2+
⎕IO←0 ⋄ ⎕ML←3
23
#.Tester.EstablishHelpersIn ⍬
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,33 @@
1-
R←Test_ZZZ_999(stopFlag batchFlag);v;n;d;xml;rf;f1;f2;f3;⎕TRAP
2-
⍝ Check the "Version" function and publish.config and history.txt
1+
R←Test_ZZZ_999(stopFlag batchFlag);v;n;d;xml;rf;f1;f2;⎕TRAP
2+
⍝ Check the "Version" function and publish.config.
33
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
44
R←∆Failed
55

6-
rf←##.EventCodes
6+
rf←#._EventCodes.EventCodes
77

88
⍝ First we check whether "Version" returns a valid result:
99
(n v d)←rf.Version
10+
v←{⍵/⍨3>+\'.'=⍵}v ⍝ Remove build ID
1011
f1←~5≤⍴v
1112
f1∨←2≠'.'+.=v
1213
f1∨←~∧/⎕D∊⍨v~'.'
1314

1415
f1∨←10≠⍴d
15-
f1∨←d[4 7]∨.≠'-'
16+
f1∨←d[4 7+⎕IO]∨.≠'-'
1617
f1∨←~∧/⎕D∊⍨d~'-'
18+
1719
⍝ publish.config must be in line with what "Version" returns of course:
1820
xml←⎕XML'flat'#.APLTreeUtils.ReadUtf8File'publish.config'
19-
f2←v≢2⊃xml[xml[;1]⍳⊂'version';]
20-
f2∨←d≢2⊃xml[xml[;1]⍳⊂'date';]
21-
22-
⍝ history.txt might be useful during development but must not exist
23-
⍝ when the project is checked in:
24-
f3←⎕NEXISTS'history.txt'
21+
f2←v≢(2+⎕IO)⊃xml[xml[;1+⎕IO]⍳⊂'version';]
22+
f2∨←d≢(2+⎕IO)⊃xml[xml[;1+⎕IO]⍳⊂'date';]
2523

2624
:If f1
2725
⎕←'Result of the "Version" function is invalid.'
2826
:EndIf
2927
:If f2
30-
⎕←'The contents of "/publish.config" is not in line with "Version".'
31-
:EndIf
32-
:If f3
33-
⎕←'There is a file "history.txt" but it shouldn''t.'
28+
⎕←'The contents of "publish.config" is not in line with "Version".'
3429
:EndIf
3530

36-
→FailsIf f1∨f2∨f3
31+
→FailsIf f1∨f2
3732

3833
R←∆OK

publish.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<tool name="EventCodes"> <version>1.2.0</version> <date>2018-02-19</date> <container>#._EventCodes</container> <files></files> <needs> <script>APLTreeUtils</script> <script>FilesAndDirs</script> <script>OS</script> <script>Tester</script> </needs> <scriptOnly>1</scriptOnly> <wsid>Development</wsid> <autoload>1</autoload> <buildid>5</buildid></tool>
1+
<tool name="EventCodes"> <version>1.2.1</version> <date>2018-10-22</date> <container>#._EventCodes</container> <files></files> <needs> <script>APLTreeUtils</script> <script>FilesAndDirs</script> <script>OS</script> <script>Tester</script> </needs> <scriptOnly>1</scriptOnly> <wsid>Development</wsid> <autoload>1</autoload> <buildid>7</buildid></tool>

0 commit comments

Comments
 (0)