ArrayMac > Function display > TEST_ENCofCSV

     ∇ r←TEST_ENCofCSV;ckFnExists;unless;aOk;aEq;on;chkFeature;ckObExists;chkFeatureLine;tfuuN;tfuu;fThis
[1]   ⍝∇ 20150825/20160914 ra⌈ --()-- test "ENCofCSV" 2015.0825                                          
[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]   tfuuN←'ENCofCSV'                                                                                  
[15]   :If 1                                                                                             
[16]       :If ~ckFnExists{⍵}tfuuN                                                                       
[17]           ⎕←APLPmtMFS tfuuN                                                                         
[18]           ⎕←0 APLPmt ThisFN''                                                                       
[19]           →XIT                                                                                      
[20]       :EndIf                                                                                        
[21]       tfuu←⍎tfuuN                                                                                   
[22]   :EndIf                                                                                            
[23]   fThis←{({⍵,'.'if×⍬⍴⍴⍵}2↓⍕⎕THIS),⍵}                                                                
[24]   ⍝⍝--                                                                                              
[25]   →XIT unless aEq'12' '34'on tfuu'12,34'                                                            
[26]   →XIT unless aEq(,⊂'12')on tfuu'12'                                                                
[27]   →XIT unless aEq'12,34' '56'on tfuu'"12,34",56'                                                    
[28]   →XIT unless aEq'{{12,34}}' '56'on tfuu'{{12,34}},56'                                              
[29]   →XIT unless aEq('12' '34')(,⊂'56')on tfuu(qTCNL,qTCLF)omrepl'12,34⍵56'                            
[30]   →XIT unless aEq'12' '' '34'on tfuu'12,,34'                                                        
[31]   →XIT unless'Unexpected for leading comma'aEq'' '12' '34'on tfuu',12,34'                           
[32]                                                                                                     
[33]   ⍝⍝--                                                                                              
[34]   :If ~1 chkFeature tfuuN omrepl'implement "⍵"'                                                     
[35]       ⎕←APLPmtMFS fThis'TEST_',tfuuN                                                                
[36]       →XIT                                                                                          
[37]   :EndIf                                                                                            
[38]   r←1                                                                                               
[39]   →XIT                                                                                              
[40]  fail2:                                                                                             
[41]   ⎕←APLPmtMFS tfuuN                                                                                 
[42]   ⎕←0 APLPmt ThisFN''                                                                               
[43]   →XIT                                                                                              
[44]  fail:                                                                                              
[45]   ⎕←APLPmtMFS fThis ThisFN''                                                                        
[46]  XIT: ⍝⍝-------                                                                                     
[47]   test_complete                                                                                     
     ∇                                                                                                   

Page served at: Wed, 08 Apr 2020 06:13:03 AST.