Skip to content

Commit

Permalink
Use the unused test struct
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Jul 8, 2024
1 parent 3335331 commit e36f4d8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ mod track_caller {
);
}

#[test]
fn track_caller_is_applied_without_context() {
let base_line = line!();
let wrap_no_context: WrapNoContext = InnerSnafu.build().into();
assert_eq!(
wrap_no_context.location.line,
base_line + 1,
"Actual location: {}",
wrap_no_context.location,
);
}

#[test]
fn track_caller_is_applied_on_result_whatever_context() {
let base_line = line!();
Expand Down Expand Up @@ -226,8 +238,4 @@ mod track_caller {
whatever.location,
);
}

// `track_caller` not supported on the `Try` trait, so we have no
// useful location for `context(false)` errors. Check back in the
// future to see if there's a fix.
}

0 comments on commit e36f4d8

Please sign in to comment.