ArrayMac > Function display > TEST_WikiTableofENCT

     ∇ r←TEST_WikiTableofENCT;ckFnExists;unless;aOk;aEq;on;chkFeature;ckObExists;chkFeatureLine;expV;datV;expF;fThis
[1]   ⍝∇ 20131209/20170126 ra⌈ --()-- test "WikiTableofENCT"                                                        
[2]    test_start                                                                                                   
[3]    r←0                                                                                                          
[4]    unless←{(~⍵)/⍺}                                                                                              
[5]    aOk←#.Assert                                                                                                 
[6]    aEq←#.AssertEq                                                                                               
[7]    on←{⍺ ⍵}                                                                                                     
[8]   ⍝⍝--------                                                                                                    
[9]    ckObExists←{(⍵ omrepl'missing "⍵"')AssertEq ⍺ on ⍬⍴⎕NC ⍵}                                                    
[10]   ckFnExists←3∘ckObExists                                                                                      
[11]   chkFeature←{⍺←0 ⋄ ('Requirement:',⍵)aEq 1 ⍺}                                                                 
[12]   chkFeatureLine←{⍺←0 ⋄ ⍺ chkFeature'⍝⍝--'{(¯1+(⍬⍴⍴⍺)+⍬⍴where ⍺⍷⍵)↓⍵}(1 atpars 2⌷[1]qSI'')FNline ⍵}            
[13]   ⍝⍝--                                                                                                         
[14]   →XIT unless ckFnExists'WikiTableofENCT'                                                                      
[15]   datV←⍕¨⍳2 2                                                                                                  
[16]   expV←1↓SSofENC'{| class="wikitable"' '|-' '|1 1' '|1 2' '|-' '|2 1' '|2 2' '|}'                              
[17]   expF←{1↓SSofENC'{| class="wikitable"' '|}'{l r←⍺ ⋄ l lk ⍵,⊂r},'|-'∘{⍺ lk ⍵}ofE'|',¨⍵}                        
[18]                                                                                                                
[19]   →XIT unless aEq expV on WikiTableofENCT datV                                                                 
[20]   →XIT unless aEq(expF datV)on WikiTableofENCT datV                                                            
[21]   →XIT unless aEq{(expF ⍵)on WikiTableofENCT ⍵}datV                                                            
[22]   →XIT unless aEq{(expF ⍵)on WikiTableofENCT ⍵}⍕¨⍳2 4                                                          
[23]                                                                                                                
[24]   expV←1↓SSofENC'{| class="wikitable"' '|-' '!1 1' '!1 2' '|-' '|2 1' '|2 2' '|}'                              
[25]   →XIT unless'Unexpected: 1 0 $ 'aEq expV on 1 0 WikiTableofENCT datV                                          
[26]                                                                                                                
[27]   r←1                                                                                                          
[28]   →XIT                                                                                                         
[29]  fail:                                                                                                         
[30]   fThis←{({⍵,'.'if×⍬⍴⍴⍵}2↓⍕⎕THIS),⍵}                                                                           
[31]   ⍝⍝--                                                                                                         
[32]   ⎕←APLPmtMFS fThis ThisFN''                                                                                   
[33]  XIT: ⍝⍝-------                                                                                                
[34]   test_complete                                                                                                
     ∇                                                                                                              

Page served at: Wed, 08 Apr 2020 06:10:25 AST.