Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Oct 9, 2024
1 parent ef02149 commit bf0deab
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/recipe/jinja.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1111,15 +1111,18 @@ mod tests {
assert_eq!(split_test("foobar", None), "[\"foobar\"]");
assert_eq!(split_test("1.2.3", Some(".")), "[\"1\", \"2\", \"3\"]");

jinja
.context_mut()
.insert("var".to_string(), Value::from_safe_string("1.2.3".to_string()));

assert_eq!(jinja
.eval(&format!("(var | split('.'))[2]"))
.unwrap()
.to_string(), "3");
jinja.context_mut().insert(
"var".to_string(),
Value::from_safe_string("1.2.3".to_string()),
);

assert_eq!(
jinja
.eval(&format!("(var | split('.'))[2]"))
.unwrap()
.to_string(),
"3"
);
}

#[test]
Expand Down

0 comments on commit bf0deab

Please sign in to comment.