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
25
25
b\
26
26
""" )
27
27
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
+ """
33
35
end
34
36
35
37
test "font is assigned to the operator struct when font descendant present" do
@@ -68,11 +70,20 @@ defmodule Mudbrick.ContentStreamTest do
68
70
|> text_position ( 0 , 700 )
69
71
|> text ( "CO₂" )
70
72
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
+ """
76
78
end
77
79
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
78
89
end
You can’t perform that action at this time.
0 commit comments