Skip to content

Commit

Permalink
fix butterfly tests
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Wrock <[email protected]>
  • Loading branch information
mwrock committed Jan 31, 2024
1 parent b5a8ef2 commit 6db2cba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions components/butterfly/src/rumor/departure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,10 @@ mod tests {
}

#[test]
#[should_panic(expected = "assertion failed")]
fn departures_with_different_member_ids_are_not_equal() {
let s1 = create_departure("mastodon");
let s2 = create_departure("limpbizkit");
assert_eq!(s1, s2);
assert_ne!(s1, s2);
}

// Order
Expand Down
9 changes: 3 additions & 6 deletions components/butterfly/src/rumor/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,29 +254,26 @@ mod tests {
}

#[test]
#[should_panic(expected = "assertion failed")]
fn services_with_different_member_ids_are_not_equal() {
let s1 = create_service("adam");
let s2 = create_service("shanku");
assert_eq!(s1, s2);
assert_ne!(s1, s2);
}

#[test]
#[should_panic(expected = "assertion failed")]
fn services_with_different_incarnations_are_not_equal() {
let s1 = create_service("adam");
let mut s2 = create_service("adam");
s2.incarnation = 1;
assert_eq!(s1, s2);
assert_ne!(s1, s2);
}

#[test]
#[should_panic(expected = "assertion failed")]
fn services_with_different_service_groups_are_not_equal() {
let s1 = create_service("adam");
let mut s2 = create_service("adam");
s2.service_group = ServiceGroup::from_str("adam.fragile").unwrap();
assert_eq!(s1, s2);
assert_ne!(s1, s2);
}

// Order
Expand Down
6 changes: 2 additions & 4 deletions components/butterfly/src/rumor/service_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,19 @@ mod tests {
}

#[test]
#[should_panic(expected = "assertion failed")]
fn service_configs_with_different_incarnations_are_not_equal() {
let s1 = create_service_config("adam", "yep");
let mut s2 = create_service_config("adam", "yep");
s2.incarnation = 1;
assert_eq!(s1, s2);
assert_ne!(s1, s2);
}

#[test]
#[should_panic(expected = "assertion failed")]
fn service_configs_with_different_service_groups_are_not_equal() {
let s1 = create_service_config("adam", "yep");
let mut s2 = create_service_config("adam", "yep");
s2.service_group = ServiceGroup::from_str("adam.fragile").unwrap();
assert_eq!(s1, s2);
assert_ne!(s1, s2);
}

// Order
Expand Down
6 changes: 2 additions & 4 deletions components/butterfly/src/rumor/service_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,19 @@ mod tests {
}

#[test]
#[should_panic(expected = "assertion failed")]
fn service_files_with_different_incarnations_are_not_equal() {
let s1 = create_service_file("adam", "yep", "tcp-backlog = 128");
let mut s2 = create_service_file("adam", "yep", "tcp-backlog = 128");
s2.incarnation = 1;
assert_eq!(s1, s2);
assert_ne!(s1, s2);
}

#[test]
#[should_panic(expected = "assertion failed")]
fn service_files_with_different_service_groups_are_not_equal() {
let s1 = create_service_file("adam", "yep", "tcp-backlog = 128");
let mut s2 = create_service_file("adam", "yep", "tcp-backlog = 128");
s2.service_group = ServiceGroup::from_str("adam.fragile").unwrap();
assert_eq!(s1, s2);
assert_ne!(s1, s2);
}

// Order
Expand Down

0 comments on commit 6db2cba

Please sign in to comment.