File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed 
lib/elixir/test/elixir/inspect Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,20 @@ defmodule Inspect.AlgebraTest do
204204    assert  render ( group ( doc ) ,  5 )  ==  "hello\n a\n b\n cd" 
205205  end 
206206
207+   test  "group modes doc"  do 
208+     doc  =  glue ( glue ( "hello" ,  "a" ) ,  "b" ) 
209+     assert  render ( doc ,  10 )  ==  "hello a b" 
210+ 
211+     assert  render ( doc  |>  glue ( "c" )  |>  group ( ) ,  10 )  == 
212+              "hello\n a\n b\n c" 
213+ 
214+     assert  render ( doc  |>  group ( :optimistic )  |>  glue ( "c" )  |>  group ( )  |>  glue ( "d" ) ,  10 )  == 
215+              "hello\n a\n b c d" 
216+ 
217+     assert  render ( doc  |>  group ( :optimistic )  |>  glue ( "c" )  |>  group ( :pessimistic )  |>  glue ( "d" ) ,  10 )  == 
218+              "hello\n a\n b c\n d" 
219+   end 
220+ 
207221  test  "no limit doc"  do 
208222    doc  =  no_limit ( group ( glue ( glue ( "hello" ,  "a" ) ,  "b" ) ) ) 
209223    assert  render ( doc ,  5 )  ==  "hello a b" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments