Add tests for crate exports ; add structure to imports/exports

This commit is contained in:
xmppftw xmppftw 2024-12-18 17:59:06 +01:00 • committed by Link Mauve
commit 7991cef904
7 changed files with 77 additions and 32 deletions

View file

@ -8,13 +8,15 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub use tokio_xmpp;
pub use tokio_xmpp::jid::{ResourcePart, ResourceRef};
pub use tokio_xmpp::jid;
pub use tokio_xmpp::minidom;
pub use tokio_xmpp::parsers;
#[macro_use]
extern crate log;
use core::fmt;
use jid::{ResourcePart, ResourceRef};
pub mod agent;
pub mod builder;
@ -30,7 +32,6 @@ pub mod presence;
pub mod pubsub;
pub mod upload;
// Module re-exports
pub use agent::Agent;
pub use builder::{ClientBuilder, ClientType};
pub use event::Event;
@ -76,6 +77,21 @@ impl fmt::Display for RoomNick {
}
}
#[cfg(test)]
mod tests {
#[test]
fn reexports() {
#[allow(unused_imports)]
use crate::jid;
#[allow(unused_imports)]
use crate::minidom;
#[allow(unused_imports)]
use crate::parsers;
#[allow(unused_imports)]
use crate::tokio_xmpp;
}
}
// The test below is dysfunctional since we have moved to StanzaStream. The
// StanzaStream will attempt to connect to foo@bar indefinitely.
// Keeping it here as inspiration for future integration tests.