#[cfg(feature = "http")]
mod http_only_tests {
#[test]
fn test_http_routes_registered() {
use sdforge::http::build;
let _app = build();
}
}
#[cfg(feature = "mcp")]
mod mcp_only_tests {
#[test]
fn test_mcp_feature_enabled() {
use sdforge::mcp;
let _ = mcp::build;
}
#[tokio::test]
async fn test_mcp_server_runs() {
use sdforge::mcp::build;
let _server = build();
}
}
#[cfg(all(feature = "http", feature = "mcp"))]
mod http_mcp_tests {
#[tokio::test]
async fn test_dual_protocol_build() {
use sdforge::http::build as http_build;
use sdforge::mcp::build as mcp_build;
let _http_app = http_build();
let _mcp_server = mcp_build();
}
}
#[cfg(all(feature = "http", feature = "streaming"))]
mod http_streaming_tests {
#[test]
fn test_streaming_routes_available() {
use sdforge::http::build;
let _app = build();
}
}
#[cfg(feature = "full")]
mod full_feature_tests {
#[tokio::test]
async fn test_full_build() {
use sdforge::http::build as http_build;
use sdforge::mcp::build as mcp_build;
let _http_app = http_build();
let _mcp_server = mcp_build();
}
}
#[cfg(feature = "ratelimit")]
#[test]
fn test_ratelimit_feature_compiles() {
use sdforge::security::ratelimit::{LimiteronAdapter, RateLimiter};
use std::sync::Arc;
let _future = LimiteronAdapter::new();
let _: Option<Arc<dyn RateLimiter>> = None;
}
#[cfg(all(feature = "security", feature = "ratelimit"))]
#[test]
fn test_security_inherits_ratelimit() {
use sdforge::security::ratelimit::RateLimiter;
use std::sync::Arc;
let _: Option<Arc<dyn RateLimiter>> = None;
}
mod feature_dependency_tests {
#[test]
#[cfg(all(feature = "streaming", not(feature = "http")))]
fn test_streaming_requires_http() {
compile_error!("Streaming feature requires HTTP feature");
}
#[test]
#[cfg(all(feature = "websocket", not(feature = "http")))]
fn test_websocket_requires_http() {
compile_error!("WebSocket feature requires HTTP feature");
}
#[test]
#[cfg(all(feature = "grpc", not(feature = "http")))]
fn test_grpc_requires_http() {
compile_error!("gRPC feature requires HTTP feature");
}
}