#![cfg(all(feature = "tokio", feature = "flow"))]
use netring::protocol::builtin::{Tcp, Udp};
use netring::protocol::event_typed::{Event, FlowEnded, FlowEstablished, FlowStarted, FlowTick};
use netring::protocol::{FlowProtocol, MessageProtocol};
fn assert_event<E: Event>() {}
fn assert_flow_protocol<P: FlowProtocol>() {}
fn assert_message_protocol<P: MessageProtocol>() {}
#[test]
fn tcp_udp_are_flow_protocols_with_lifecycle_events() {
assert_flow_protocol::<Tcp>();
assert_flow_protocol::<Udp>();
assert_event::<FlowStarted<Tcp>>();
assert_event::<FlowEstablished<Tcp>>();
assert_event::<FlowEnded<Tcp>>();
assert_event::<FlowTick<Tcp>>();
assert_event::<FlowStarted<Udp>>();
assert_event::<FlowEnded<Udp>>();
}
#[cfg(feature = "icmp")]
#[test]
fn icmp_is_both_flow_and_message_protocol() {
use netring::protocol::builtin::Icmp;
assert_flow_protocol::<Icmp>();
assert_message_protocol::<Icmp>();
assert_event::<FlowStarted<Icmp>>(); assert_event::<Icmp>(); }
#[cfg(feature = "http")]
#[test]
fn http_is_message_only() {
use netring::protocol::builtin::Http;
assert_message_protocol::<Http>();
assert_event::<Http>();
}
#[cfg(feature = "dns")]
#[test]
fn dns_is_message_only() {
use netring::protocol::builtin::Dns;
assert_message_protocol::<Dns>();
assert_event::<Dns>();
}