Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Mar 24, 2024
1 parent 2a93400 commit 231a3f5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,11 @@ impl Template {
LineColLocation::Pos(line_col) => line_col,
LineColLocation::Span(line_col, _) => line_col,
};
TemplateError::of(TemplateErrorReason::InvalidSyntax(e.variant.message().to_string()))
.at(source, line_no, col_no)
.in_template(options.name())
TemplateError::of(TemplateErrorReason::InvalidSyntax(
e.variant.message().to_string(),
))
.at(source, line_no, col_no)
.in_template(options.name())
})?;

// dbg!(parser_queue.clone().flatten());
Expand Down Expand Up @@ -1133,7 +1135,10 @@ mod test {

let terr = Template::compile(source).unwrap_err();

assert!(matches!(terr.reason(), TemplateErrorReason::InvalidSyntax(_)));
assert!(matches!(
terr.reason(),
TemplateErrorReason::InvalidSyntax(_)
));
assert_eq!(terr.pos(), Some((4, 5)));
}

Expand Down Expand Up @@ -1253,7 +1258,11 @@ mod test {
TemplateErrorReason::InvalidSyntax(s) => s,
_ => panic!("InvalidSyntax expected"),
};
assert!(syntax_error_msg.contains("expected identifier"), "{}", syntax_error_msg);
assert!(
syntax_error_msg.contains("expected identifier"),
"{}",
syntax_error_msg
);
}
}

Expand Down

0 comments on commit 231a3f5

Please sign in to comment.