File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -331,6 +331,33 @@ fn test_stacktrace() {
331
331
) ;
332
332
}
333
333
334
+ #[ test]
335
+ fn test_template_info ( ) {
336
+ let event = v7:: Event {
337
+ template_info : Some ( v7:: TemplateInfo {
338
+ location : v7:: FileLocation {
339
+ filename : Some ( "hello.html" . into ( ) ) ,
340
+ line : Some ( 1 ) ,
341
+ ..Default :: default ( )
342
+ } ,
343
+ source : v7:: EmbeddedSources {
344
+ pre_lines : vec ! [ "foo1" . into( ) , "bar2" . into( ) ] ,
345
+ current_line : Some ( "hey hey hey3" . into ( ) ) ,
346
+ post_lines : vec ! [ "foo4" . into( ) , "bar5" . into( ) ] ,
347
+ } ,
348
+ } ) ,
349
+ ..Default :: default ( )
350
+ } ;
351
+
352
+ assert_roundtrip ( & event) ;
353
+ assert_eq ! (
354
+ serde_json:: to_string( & event) . unwrap( ) ,
355
+ "{\" template\" :{\" filename\" :\" hello.html\" ,\" lineno\" :1,\
356
+ \" pre_context\" :[\" foo1\" ,\" bar2\" ],\" context_line\" :\
357
+ \" hey hey hey3\" ,\" post_context\" :[\" foo4\" ,\" bar5\" ]}}"
358
+ ) ;
359
+ }
360
+
334
361
#[ test]
335
362
fn test_request ( ) {
336
363
let event = v7:: Event {
You can’t perform that action at this time.
0 commit comments