File tree Expand file tree Collapse file tree 1 file changed +21
-10
lines changed Expand file tree Collapse file tree 1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,13 @@ defmodule Mudbrick.ContentStreamTest do
2525      b\ 
2626      """ ) 
2727
28-     [ apostrophe ,  tj ,  leading  |  _ ]  =  content_stream . value . operations 
29- 
30-     assert  Object . from ( leading )  |>  to_string ( )  ==  "12.0 TL" 
31-     assert  Object . from ( tj )  |>  to_string ( )  ==  "<00A5> Tj" 
32-     assert  Object . from ( apostrophe )  |>  to_string ( )  ==  "<00B4> '" 
28+     assert  content_stream . value . operations 
29+            |>  render ( 3 )  == 
30+              """ 
31+              12.0 TL 
32+              <00A5> Tj 
33+              <00B4> '\ 
34+              """ 
3335  end 
3436
3537  test  "font is assigned to the operator struct when font descendant present"  do 
@@ -68,11 +70,20 @@ defmodule Mudbrick.ContentStreamTest do
6870        |>  text_position ( 0 ,  700 ) 
6971        |>  text ( "CO₂" ) 
7072
71-       [ show_text_operation   |   _ ]   =  content_stream . value . operations 
72- 
73-       assert   Object . from ( show_text_operation )   |>   to_string ( )   ==  """ 
74-              <001100550174> Tj\ 
75-              """ 
73+       assert  content_stream . value . operations 
74+               |>   render ( 1 )   == 
75+                 """ 
76+                 <001100550174> Tj\ 
77+                 """ 
7678    end 
7779  end 
80+ 
81+   defp  render ( ops ,  n )  do 
82+     ops 
83+     |>  Enum . take ( n ) 
84+     |>  Enum . reverse ( ) 
85+     |>  Enum . map_join ( "\n " ,  fn  op  -> 
86+       Object . from ( op )  |>  to_string ( ) 
87+     end ) 
88+   end 
7889end 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments