Skip to content

Commit 541dac3

Browse files
committed
fix formatting
1 parent b898c9d commit 541dac3

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/parser/bmp/messages/peer_up_notification.rs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ pub fn parse_peer_up_notification(
141141
#[cfg(test)]
142142
mod tests {
143143
use super::*;
144+
use crate::models::capabilities::{BgpCapabilityType, MultiprotocolExtensionsCapability};
144145
use bytes::BytesMut;
145146
use std::net::{IpAddr, Ipv4Addr};
146-
use crate::models::capabilities::{BgpCapabilityType, MultiprotocolExtensionsCapability};
147147

148148
#[test]
149149
fn test_parse_peer_up_notification() {
@@ -486,7 +486,8 @@ mod tests {
486486
let asn_len = AsnLength::Bits32;
487487
let peer_type = BmpPeerType::LocalRib;
488488

489-
let result = parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
489+
let result =
490+
parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
490491

491492
assert!(result.is_ok(), "Parsing should succeed");
492493
// In production, a warning would be logged about missing multiprotocol capability
@@ -535,7 +536,8 @@ mod tests {
535536
let asn_len = AsnLength::Bits32;
536537
let peer_type = BmpPeerType::LocalRib;
537538

538-
let result = parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
539+
let result =
540+
parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
539541

540542
assert!(result.is_ok(), "Parsing should succeed");
541543
// No warning should be logged when multiprotocol capability is present
@@ -589,7 +591,8 @@ mod tests {
589591
let asn_len = AsnLength::Bits32;
590592
let peer_type = BmpPeerType::LocalRib;
591593

592-
let result = parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
594+
let result =
595+
parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
593596

594597
assert!(result.is_ok(), "Parsing should succeed");
595598
// In production, a warning would be logged about missing VrTableName TLV
@@ -643,13 +646,17 @@ mod tests {
643646
let asn_len = AsnLength::Bits32;
644647
let peer_type = BmpPeerType::LocalRib;
645648

646-
let result = parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
649+
let result =
650+
parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
647651

648652
assert!(result.is_ok(), "Parsing should succeed");
649653

650654
let peer_notification = result.unwrap();
651655
assert_eq!(peer_notification.tlvs.len(), 1);
652-
assert_eq!(peer_notification.tlvs[0].info_type, PeerUpTlvType::VrTableName);
656+
assert_eq!(
657+
peer_notification.tlvs[0].info_type,
658+
PeerUpTlvType::VrTableName
659+
);
653660
assert_eq!(peer_notification.tlvs[0].info_value, "LocalRIB");
654661
// No warnings should be logged with valid VrTableName
655662
}
@@ -701,7 +708,8 @@ mod tests {
701708
let asn_len = AsnLength::Bits32;
702709
let peer_type = BmpPeerType::LocalRib;
703710

704-
let result = parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
711+
let result =
712+
parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
705713

706714
assert!(result.is_ok(), "Parsing should succeed");
707715
// In production, a warning would be logged about invalid VrTableName length
@@ -756,7 +764,8 @@ mod tests {
756764
let asn_len = AsnLength::Bits32;
757765
let peer_type = BmpPeerType::LocalRib;
758766

759-
let result = parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
767+
let result =
768+
parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
760769

761770
assert!(result.is_ok(), "Parsing should succeed");
762771
// In production, a warning would be logged about oversized VrTableName
@@ -792,7 +801,8 @@ mod tests {
792801
let asn_len = AsnLength::Bits32;
793802
let peer_type = BmpPeerType::Global; // Not LocalRib
794803

795-
let result = parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
804+
let result =
805+
parse_peer_up_notification(&mut data.freeze(), &afi, &asn_len, Some(&peer_type));
796806

797807
assert!(result.is_ok(), "Parsing should succeed");
798808
// No warnings should be logged for non-LocalRib peer types

0 commit comments

Comments
 (0)