@@ -87,15 +87,15 @@ return {
8787 .. doclayout .literal ' How' .. doclayout .space
8888 .. doclayout .literal ' are' .. doclayout .space
8989 .. doclayout .literal ' you?'
90- assert .are_equal (doclayout . render (greeting , 7 ), ' Hi! How\n are\n you?' )
90+ assert .are_equal (greeting : render (7 ), ' Hi! How\n are\n you?' )
9191 end ),
9292 test (' after_break' , function ()
9393 local doc = doclayout .literal ' hi'
9494 + doclayout .after_break ' !'
9595 .. doclayout .after_break ' ?'
9696 .. doclayout .literal ' x'
9797 .. doclayout .after_break ' ?'
98- assert .are_equal (doclayout . render (doc , 2 ), ' hi\n !x' )
98+ assert .are_equal (doc : render (2 ), ' hi\n !x' )
9999 end ),
100100 test (' before_non_blank' , function ()
101101 local doc = doclayout .before_non_blank ' !!' .. ' ab'
@@ -148,15 +148,22 @@ return {
148148 end ),
149149 test (' nowrap' , function ()
150150 local doc = doclayout .nowrap (doclayout .literal ' first' + ' second' )
151- assert .are_equal (doclayout . render (doc , 8 ), ' first second' )
151+ assert .are_equal (doc : render (8 ), ' first second' )
152152 end ),
153153 test (' parens' , function ()
154154 local doc = doclayout .parens ' lisp'
155155 assert .are_equal (doclayout .render (doc ), ' (lisp)' )
156+ -- as method
157+ assert .are_equal (doc :parens ():render (), ' ((lisp))' )
156158 end ),
157159 test (' prefixed' , function ()
158160 local doc = doclayout .prefixed (doclayout .literal ' aa' // ' bb' , ' # ' )
159161 assert .are_equal (doclayout .render (doc ), ' # aa\n #\n # bb' )
162+ -- as method
163+ assert .are_equal (
164+ (doclayout .literal ' aa' // ' bb' ):prefixed (' # ' ):render (),
165+ ' # aa\n #\n # bb'
166+ )
160167 end ),
161168 group ' table helpers' {
162169 test (' cblock' , function ()
0 commit comments