From cb7507278c25fdc798e03f0ad22c17d9922d8c29 Mon Sep 17 00:00:00 2001 From: Joel Wachsler Date: Tue, 12 Jul 2022 10:45:19 +0000 Subject: [PATCH] Add access test --- .../tests/access_impl_types.rs | 16 ++++++++++++++++ qbittorrent-web-api-gen/tests/tests.rs | 1 + 2 files changed, 17 insertions(+) create mode 100644 qbittorrent-web-api-gen/tests/access_impl_types.rs diff --git a/qbittorrent-web-api-gen/tests/access_impl_types.rs b/qbittorrent-web-api-gen/tests/access_impl_types.rs new file mode 100644 index 0000000..cc59017 --- /dev/null +++ b/qbittorrent-web-api-gen/tests/access_impl_types.rs @@ -0,0 +1,16 @@ +use anyhow::Result; + +mod foo { + use qbittorrent_web_api_gen::QBittorrentApiGen; + + #[allow(dead_code)] + #[derive(QBittorrentApiGen)] + struct Api {} +} + +#[tokio::main] +async fn main() -> Result<()> { + let _ = foo::api_impl::ApplicationPreferencesBittorrentProtocol::TCP; + + Ok(()) +} diff --git a/qbittorrent-web-api-gen/tests/tests.rs b/qbittorrent-web-api-gen/tests/tests.rs index b2bbc2b..61f2cd2 100644 --- a/qbittorrent-web-api-gen/tests/tests.rs +++ b/qbittorrent-web-api-gen/tests/tests.rs @@ -18,4 +18,5 @@ fn tests() { // --- Misc --- t.pass("tests/add_torrent.rs"); t.pass("tests/another_struct_name.rs"); + t.pass("tests/access_impl_types.rs"); }