Skip to content

Commit 6ef8054

Browse files
committed
[Test] add variable to test case
1 parent a63dac0 commit 6ef8054

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ extern crate log;
608608
609609
fn main() {
610610
env_logger::init();
611-
debug!("you're only as funky\n as your last cut");
611+
let adjective = "funky";
612+
debug!("you're only as {}\n as your last cut", adjective);
612613
}
613614
"#;
614615
#[test]
@@ -630,10 +631,16 @@ fn main() {
630631
.unwrap()
631632
.log_statements;
632633
assert_eq!(src_refs.len(), 1);
633-
println!("`{}`", log_ref.body());
634-
println!("`{}`", src_refs[0].matcher);
635634
let result = link_to_source(&log_ref, &src_refs);
636635
assert!(ptr::eq(result.unwrap(), &src_refs[0]));
636+
let vars = extract_variables(&log_ref, &src_refs[0]);
637+
assert_eq!(
638+
vars,
639+
[VariablePair {
640+
expr: "adjective".to_string(),
641+
value: "funky".to_string()
642+
}]
643+
);
637644
}
638645

639646
#[test]

0 commit comments

Comments
 (0)