File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed 
src/test/java/javascalautils Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -126,13 +126,27 @@ public void map() {
126126        assertEquals (TEXT_VALUE .length (), mapped .get ().intValue ());
127127    }
128128
129+     @ Test (expected  = BrokenFunctionException .class )
130+     public  void  map_fail () {
131+         option .map (v  -> {
132+             throw  new  Exception ("Oh darn, this went FUBAR!" );
133+         });
134+     }
135+ 
129136    @ Test 
130137    public  void  flatMap () {
131138        Option <Integer > mapped  = option .flatMap (v  -> Option .apply (v .length ()));
132139        assertTrue (mapped .isDefined ());
133140        assertEquals (TEXT_VALUE .length (), mapped .get ().intValue ());
134141    }
135142
143+     @ Test (expected  = BrokenFunctionException .class )
144+     public  void  flatMap_fail () {
145+         option .flatMap (v  -> {
146+             throw  new  Exception ("Oh darn, this went FUBAR!" );
147+         });
148+     }
149+ 
136150    @ Test 
137151    public  void  isEmpty () {
138152        assertFalse (option .isEmpty ());
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments