Skip to content

Commit

Permalink
Add test for capturing the second part of the serial number
Browse files Browse the repository at this point in the history
  • Loading branch information
RossSmyth committed Jul 10, 2024
1 parent 916c2fd commit daf2c64
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/windows/enumerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ pub fn available_ports() -> Result<Vec<SerialPortInfo>> {

#[test]
fn test_parsing_usb_port_information() {
let madeup_hwid = r"USB\VID_1D50&PID_6018+6&A694CA9&0&0000";
let info = parse_usb_port_info(madeup_hwid, None).unwrap();
assert_eq!(info.serial_number, Some("A694CA9".to_string()));

let bm_uart_hwid = r"USB\VID_1D50&PID_6018&MI_02\6&A694CA9&0&0000";
let bm_parent_hwid = r"USB\VID_1D50&PID_6018\85A12F01";
let info = parse_usb_port_info(bm_uart_hwid, Some(bm_parent_hwid)).unwrap();
Expand Down

0 comments on commit daf2c64

Please sign in to comment.