From 5496e155671c06c2a00467557cb9167d2ebbd0f0 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Sun, 12 May 2024 10:41:08 +0200 Subject: [PATCH] add test for adapter not found --- tests/adapter_tests.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/adapter_tests.rs b/tests/adapter_tests.rs index 420eb52..865b03b 100644 --- a/tests/adapter_tests.rs +++ b/tests/adapter_tests.rs @@ -130,3 +130,14 @@ async fn vcan_bulk_send_fd() { .send(&Frame::new(0, 0x123.into(), &[0u8; 64]).unwrap()) .await; } + +#[tokio::test] +#[serial_test::serial] +async fn socketcan_open_nonexistent() { + let e = automotive::socketcan::SocketCan::new("doestnotexist"); + + match e { + Err(automotive::Error::NotFound) => {} + _ => panic!("Expected NotFound error"), + } +}