Skip to content

Commit a7e5db5

Browse files
committed
Tests amended
1 parent 35f0744 commit a7e5db5

17 files changed

+95
-20
lines changed

APLSource/TestCases/Test_Helpers_01.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
r←Test_Helpers_01(debugFlag batchFlag);⎕TRAP;list1;list2;list3
2-
⍝ Exercise `ListTestFunctions`.
2+
⍝ Exercise `ListTestFunctions` with a simple argumet
33
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
44
r←T._Failed
55

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
r←Test_Misc_18(debugFlag batchFlag);rc;list;tmp;expected;⎕TRAP;T2
2-
⍝ Exercise the `ListGroups` and the `ListTestFunctions` methods.
1+
r←Test_Helpers_05(debugFlag batchFlag);rc;list;tmp;expected;⎕TRAP;T2
2+
⍝ Exercise the `ListTestFunctions` methods with wildcard argument
33
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
44
r←T._Failed
55

@@ -22,6 +22,5 @@
2222
⍝ The tests
2323
→T.PassesIf(⊃⍴T2.ListTestFunctions'')=≢'T'tmp.⎕NL 3
2424
→T.PassesIf(+/'Test_Grp'{((≢⍺)↑[2]⍵)∧.=⍺}'T'tmp.⎕NL 3)=≢T2.ListTestFunctions'Grp*'
25-
→T.PassesIf 5=1↑⍴T2.ListGroups
2625

2726
r←T._OK
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
r←Test_Helpers_06(debugFlag batchFlag);rc;list;tmp;expected;⎕TRAP;T2;res
2+
⍝ Exercise the `ListTestFunctions` methods with multiple arguments
3+
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
4+
r←T._Failed
5+
6+
⍝ Pre-conditions
7+
tmp←⎕NS''
8+
tmp.⎕FX'r←Test_001 (x y)' ' ⍝ Comment: Test_001' 'r←0'
9+
tmp.⎕FX'r←Test_002 (x y)' ' ⍝ Comment: Test_002' 'r←0'
10+
tmp.⎕FX'r←Test_003 (x y)' ' ⍝ Comment: Test_003' 'r←0'
11+
tmp.⎕FX'r←Test_Grp1_001 (x y)' ' ⍝ Comment: Grp1_001' 'r←0'
12+
tmp.⎕FX'r←Test_Grp1_002 (x y)' ' ⍝ Comment: Grp1_002' 'r←0'
13+
tmp.⎕FX'r←Test_Grp1_003 (x y)' ' ⍝ Comment: Grp1_003' 'r←0'
14+
tmp.⎕FX'r←Test_Grp2_001 (x y)' ' ⍝ Comment: Grp2_001' 'r←0'
15+
tmp.⎕FX'r←Test_Grp2_002 (x y)' ' ⍝ Comment: Grp2_002' 'r←0'
16+
tmp.⎕FX'r←Test_Grp3_AAA_001 (x y)' ' ⍝ Comment: Grp3_AAA_001' 'r←0'
17+
tmp.⎕FX'r←Test_Grp3_AAA_002 (x y)' ' ⍝ Comment: Grp3_AAA_002' 'r←0'
18+
tmp.⎕FX'r←Test_Grp3_BBB_001 (x y)' ' ⍝ Comment: Grp3_BBB_001' 'r←0'
19+
tmp.⎕FX'r←Test_Grp4_CCC_001 (x y)' ' ⍝ Comment: Grp4_CCC_001' 'r←0'
20+
tmp.⎕FX'r←Test_Foo_001 (x y)' ' ⍝ Comment: Foo_001' 'r←0'
21+
tmp.⎕FX'r←Test_Foo_002 (x y)' ' ⍝ Comment: Foo_002' 'r←0'
22+
T2←⎕NEW ##.Tester2 tmp
23+
24+
res←T2.ListTestFunctions'Foo*,Grp*'
25+
→T.PassesIf∧/'Comment:'∘{⍺≡(≢⍺)↑⍵}¨res[;2]
26+
expected←'Test_Foo' 'Test_Grp1' 'Test_Grp2' 'Test_Grp3' 'Test_Grp4'
27+
→T.PassesIf∧/({⍵↑⍨+/2>+\'_'=⍵}¨res[;1])∊expected
28+
29+
30+
r←T._OK
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
r←Test_Helpers_07(debugFlag batchFlag);rc;list;tmp;⎕TRAP;T2;res
2+
⍝ Exercise the `ListTestFunctions` methods with multiple arguments and a left argument
3+
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
4+
r←T._Failed
5+
6+
⍝ Pre-conditions
7+
tmp←⎕NS''
8+
tmp.⎕FX'r←Test_001 (x y)' ' ⍝ Comment: Test_001' 'r←0'
9+
tmp.⎕FX'r←Test_002 (x y)' ' ⍝ Comment: Test_002' 'r←0'
10+
tmp.⎕FX'r←Test_003 (x y)' ' ⍝ Comment: Test_003' 'r←0'
11+
tmp.⎕FX'r←Test_Grp1_001 (x y)' ' ⍝ Comment: Grp1_001' 'r←0'
12+
tmp.⎕FX'r←Test_Grp1_002 (x y)' ' ⍝ Comment: Grp1_002' 'r←0'
13+
tmp.⎕FX'r←Test_Grp1_003 (x y)' ' ⍝ Comment: Grp1_003' 'r←0'
14+
tmp.⎕FX'r←Test_Grp2_001 (x y)' ' ⍝ Comment: Grp2_001' 'r←0'
15+
tmp.⎕FX'r←Test_Grp2_002 (x y)' ' ⍝ Comment: Grp2_002' 'r←0'
16+
tmp.⎕FX'r←Test_Grp3_AAA_001 (x y)' ' ⍝ Comment: Grp3_AAA_001' 'r←0'
17+
tmp.⎕FX'r←Test_Grp3_AAA_002 (x y)' ' ⍝ Comment: Grp3_AAA_002' 'r←0'
18+
tmp.⎕FX'r←Test_Grp3_BBB_001 (x y)' ' ⍝ Comment: Grp3_BBB_001' 'r←0'
19+
tmp.⎕FX'r←Test_Grp4_CCC_001 (x y)' ' ⍝ Comment: Grp4_CCC_001' 'r←0'
20+
tmp.⎕FX'r←Test_Foo_001 (x y)' ' ⍝ Comment: Foo_001' 'r←0'
21+
tmp.⎕FX'r←Test_Foo_002 (x y)' ' ⍝ Comment: Foo_002' 'r←0'
22+
T2←⎕NEW ##.Tester2 tmp
23+
24+
res←2 T2.ListTestFunctions'Foo*,Grp*'
25+
→T.PassesIf∧/'Comment:'∘{⍺≡(≢⍺)↑⍵}¨res[;2]
26+
→T.PassesIf 2∧.=⊃∘APLTreeUtils2.ToNum¨{⍵↑⍨-¯1+'_'⍳⍨⌽⍵}¨res[;1]
27+
28+
r←T._OK
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
r←Test_Misc_20(debugFlag batchFlag);⎕TRAP;list
1+
r←Test_Helpers_20(debugFlag batchFlag);⎕TRAP;list
22
⍝ Test whether local vars spreading over more than one line are handled correctly
33
⎕TRAP←(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
44
r←T._Failed

APLSource/TestCases/Test_Misc_81.aplf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
Assert 0=≢#.TEMP.⎕NL 3
99

10-
##.CommTools.YesOrNo_Answers←1 2⍴'Helpers@' 'N'
10+
##.CommTools.AddAutomation'YesOrNo' 'Helpers@' 'N'
1111
res←##.Tester2.EstablishHelpers #.TEMP
1212
→T.GoToTidyUp~0=≢res
1313
→T.GoToTidyUp 0≠≢#.TEMP.⎕NL 3
1414

15-
##.CommTools.YesOrNo_Answers←1 2⍴'Helpers@' 'Y'
15+
1 ##.CommTools.AddAutomation'YesOrNo' 'Helpers@' 'Y'
1616
res←##.Tester2.EstablishHelpers #.TEMP
1717
→T.GoToTidyUp 0=≢res
1818
→T.GoToTidyUp 3≠≢#.TEMP.⎕NL 3

APLSource/TestCases/Test_Stop_001.aplf

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

66
T2←⎕NEW ##.Tester2 TestCasesSimu
77
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' ⋄ #.TEMP.success←0
8-
##.CommTools.Select_Choices←1 2⍴'WhereToStop@' 1
8+
##.CommTools.AddAutomation'Select' 'WhereToStop@' 1
99

1010
⎕TRAP←(⊂1001 'E' '→PassesIf ∆stop_before_test=⊃⎕lc ⋄ →⎕lc,#.TEMP.success←1'),⎕TRAP
1111
{}'?'T2.RunThese 1

APLSource/TestCases/Test_Stop_002.aplf

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

66
T2←⎕NEW ##.Tester2 TestCasesSimu
77
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' ⋄ #.TEMP.success←0
8-
##.CommTools.Select_Choices←1 2⍴'WhereToStop@' 2
8+
##.CommTools.AddAutomation'Select' 'WhereToStop@' 2
99

1010
⎕TRAP←(⊂1001 'E' '→PassesIf ∆stop_before_initial_3=⊃⎕lc ⋄ →⎕lc,#.TEMP.success←1'),⎕TRAP
1111
{}'?'T2.RunThese 1

APLSource/TestCases/Test_Stop_003.aplf

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

66
T2←⎕NEW ##.Tester2 TestCasesSimu
77
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS'' ⋄ #.TEMP.success←0
8-
##.CommTools.Select_Choices←1 2⍴'WhereToStop@' 3
8+
##.CommTools.AddAutomation'Select' 'WhereToStop@' 3
99

1010
⎕TRAP←(⊂1001 'E' '→PassesIf ∆stop_before_cleanup_2=⊃⎕lc ⋄ →⎕lc,#.TEMP.success←1'),⎕TRAP
1111
{}'?'T2.RunThese 1

APLSource/TestCases/Test_Stop_004.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#.⎕SHADOW'TEMP' ⋄ 'TEMP'#.⎕NS''
88
#.TEMP.counter←0
99
#.TEMP.labels←'∆stop_before_test' '∆stop_before_initial_1' '∆stop_before_initial_2' '∆stop_before_initial_3' '∆stop_before_initial_4'
10-
##.CommTools.Select_Choices←1 2⍴'WhereToStop@' 4
10+
##.CommTools.AddAutomation'Select' 'WhereToStop@' 4
1111

1212
⎕TRAP←(⊂1001 'E' 'Assert (⊃⎕lc)∊{⍎¨(⎕nc ⍵)/⍵}#.TEMP.labels ⋄ #.TEMP.counter+←1 ⋄ →⎕lc'),⎕TRAP
1313
{}'?'T2.RunThese'Grouping'

0 commit comments

Comments
 (0)