Skip to content

Commit

Permalink
Added panic unit test for format
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishajr authored and hurl-bot committed Jan 20, 2025
1 parent a9de5f6 commit baddf60
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions packages/hurl/src/runner/filter/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ mod tests {
}

#[test]
fn eavl_filter_format_ok() {
fn eval_filter_format_ok() {
let variables = VariableSet::new();

let date = Utc.with_ymd_and_hms(2025, 1, 1, 0, 0, 0).unwrap();
Expand All @@ -90,7 +90,7 @@ mod tests {
}

#[test]
fn eavl_filter_format_ko_bad_input_type() {
fn eval_filter_format_ko_bad_input_type() {
let variables = VariableSet::new();

let filter = new_format_filter("%m/%d/%Y");
Expand All @@ -105,4 +105,19 @@ mod tests {
RunnerErrorKind::FilterInvalidInput("string".to_string())
);
}

#[test]
#[should_panic]
fn eval_filter_format_ko_invalid_format() {
let variables = VariableSet::new();

let filter = new_format_filter("%%");
eval_filter(
&filter,
&Value::String("01/01/2025".to_string()),
&variables,
false,
)
.unwrap();
}
}

0 comments on commit baddf60

Please sign in to comment.