Skip to content

Commit

Permalink
test: split tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Apr 18, 2024
1 parent d95f3c0 commit 3f83f38
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tokio-console/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ mod tests {
// Therefore, it's important to ensure that paths, which can differ between operating systems,
// are displayed correctly in the console.
#[test]
fn test_format_location() {
fn test_format_location_linux() {
// Linux style paths.
let location1 = proto::Location {
file: Some(
Expand Down Expand Up @@ -580,6 +580,11 @@ mod tests {
"/home/user/projects/tokio-1.0.1/src/lib.rs"
);

assert_eq!(format_location(None), "<unknown location>");
}

#[test]
fn test_format_location_macos() {
// macOS style paths.
let location4 = proto::Location { file: Some("/Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.0.1/src/lib.rs".to_string()), ..Default::default() };
let location5 = proto::Location {
Expand All @@ -603,7 +608,5 @@ mod tests {
format_location(Some(location6)),
"/Users/user/projects/tokio-1.0.1/src/lib.rs"
);

assert_eq!(format_location(None), "<unknown location>");
}
}

0 comments on commit 3f83f38

Please sign in to comment.