#[cfg(test)]
mod tests {
    use dbnexus::tracing::sampler::create_trace_provider_with_sampling;

    #[test]
    fn test_create_with_full_sampling() {
        let provider = create_trace_provider_with_sampling(1.0);
        assert!(provider.is_ok());
    }

    #[test]
    fn test_create_with_half_sampling() {
        let provider = create_trace_provider_with_sampling(0.5);
        assert!(provider.is_ok());
    }

    #[test]
    fn test_create_with_no_sampling() {
        let provider = create_trace_provider_with_sampling(0.0);
        assert!(provider.is_ok());
    }

    #[test]
    fn test_create_with_sampling_clamped() {
        // 采样率应该被限制在 [0.0, 1.0] 范围内
        let provider_high = create_trace_provider_with_sampling(2.0);
        assert!(provider_high.is_ok());

        let provider_low = create_trace_provider_with_sampling(-1.0);
        assert!(provider_low.is_ok());
    }
}
