#![cfg(feature = "cstr")]
extern crate alloc;
use alloc::{rc::Rc, sync::Arc};
#[cfg(feature = "serde")]
use flexstr::{LocalCStr, SharedCStr};
use core::ffi::CStr;
mod common;
#[cfg(feature = "serde")]
#[test]
fn serialize_deserialize_test_local_cstr() {
common::serialize::serialize_deserialize_test::<LocalCStr, CStr>(c"test");
}
#[cfg(feature = "serde")]
#[test]
fn serialize_deserialize_test_shared_cstr() {
common::serialize::serialize_deserialize_test::<SharedCStr, CStr>(c"test");
}
#[test]
fn test_creation_from_borrowed_cstr() {
common::basic::test_creation_from_borrowed::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_creation_from_inline_cstr() {
common::basic::test_creation_from_inline::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_creation_from_ref_counted_cstr() {
common::basic::test_creation_from_ref_counted::<CStr, Arc<CStr>>(c"test".into());
}
#[test]
fn test_empty_cstr() {
common::basic::test_empty::<CStr, Arc<CStr>>(c"");
}
#[test]
fn test_accessors_cstr() {
common::basic::test_accessors::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_clone_all_variants_cstr() {
common::basic::test_clone_all_variants::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_default_cstr() {
common::basic::test_default::<CStr, Arc<CStr>>();
}
#[test]
fn test_to_owned_cstr() {
common::conversion::test_to_owned::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_into_owned_cstr() {
common::conversion::test_into_owned::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_to_owned_type_cstr() {
common::conversion::test_to_owned_type::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_optimize_cstr() {
common::conversion::test_optimize::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_from_borrowed_ref_cstr() {
common::conversion::test_from_borrowed_ref::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_from_inline_flex_str_cstr() {
common::conversion::test_from_inline_flex_str::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_partial_eq_cstr() {
common::comparison::test_partial_eq::<CStr, Arc<CStr>>(c"test", c"test");
common::comparison::test_partial_eq::<CStr, Arc<CStr>>(c"test", c"other");
}
#[test]
fn test_eq_cstr() {
common::comparison::test_eq::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_hash_cstr() {
common::comparison::test_hash::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_comparison_with_ref_cstr() {
common::comparison::test_comparison_with_ref::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_variant_queries_cstr() {
common::storage::test_variant_queries::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_transition_borrowed_to_inlined_cstr() {
common::storage::test_transition_borrowed_to_inlined::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_storage_optimization_cstr() {
common::storage::test_storage_optimization::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_empty_string_cstr() {
common::edge_cases::test_empty_string::<CStr, Arc<CStr>>(c"");
}
#[test]
fn test_various_lengths_cstr() {
common::edge_cases::test_various_lengths::<CStr, Arc<CStr>>(c"test");
common::edge_cases::test_various_lengths::<CStr, Arc<CStr>>(c"");
}
#[test]
fn test_special_content_cstr() {
common::edge_cases::test_special_content::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_clone_variants_cstr() {
common::edge_cases::test_clone_variants::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_interior_nul_error() {
common::errors::test_interior_nul_error();
}
#[test]
fn test_too_long_or_nul_error_too_long() {
common::errors::test_too_long_or_nul_error_too_long();
}
#[test]
fn test_too_long_or_nul_error_nul() {
common::errors::test_too_long_or_nul_error_nul();
}
#[test]
fn test_as_c_str() {
common::stringlike::test_as_c_str::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_into_c_string() {
common::stringlike::test_into_c_string::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_to_c_string() {
common::stringlike::test_to_c_string::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_try_from_bytes_with_nul() {
common::cstr_specific::test_try_from_bytes_with_nul::<Arc<CStr>>();
}
#[test]
fn test_try_from_bytes_without_nul() {
common::cstr_specific::test_try_from_bytes_without_nul::<Arc<CStr>>();
}
#[test]
fn test_try_from_bytes_interior_nul() {
common::cstr_specific::test_try_from_bytes_interior_nul::<Arc<CStr>>();
}
#[test]
fn test_as_bytes_with_nul() {
common::cstr_specific::test_as_bytes_with_nul::<Arc<CStr>>(c"test");
}
#[test]
fn test_mutation_borrowed_shared_cstr() {
common::mutate_fallback::test_mutation_immutable_bytes_borrowed::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_mutation_borrowed_local_cstr() {
common::mutate_fallback::test_mutation_immutable_bytes_borrowed::<CStr, Rc<CStr>>(c"test");
}
#[test]
fn test_mutation_inlined_shared_cstr() {
common::mutate_fallback::test_mutation_immutable_bytes_inlined::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_mutation_inlined_local_cstr() {
common::mutate_fallback::test_mutation_immutable_bytes_inlined::<CStr, Rc<CStr>>(c"test");
}
#[test]
fn test_mutation_shared_ref_counted_cstr() {
common::mutate_fallback::test_mutation_immutable_bytes_ref_counted::<CStr, Arc<CStr>>(
c"test".into(),
);
}
#[test]
fn test_mutation_local_ref_counted_cstr() {
common::mutate_fallback::test_mutation_immutable_bytes_ref_counted::<CStr, Rc<CStr>>(
c"test".into(),
);
}
#[test]
fn test_mutation_boxed_cstr() {
common::mutate_fallback::test_mutation_immutable_bytes_boxed::<CStr, Arc<CStr>>(c"test".into());
}
#[test]
fn test_partial_eq_with_owned_types_cstr() {
common::comparison::test_partial_eq_with_owned_types::<CStr, Arc<CStr>>(c"test");
}
#[test]
fn test_try_from_str_cstr() {
common::try_from::test_try_from_str_cstr::<Arc<CStr>>();
}
#[test]
fn test_try_from_bytes_cstr() {
common::try_from::test_try_from_bytes_cstr::<Arc<CStr>>();
}
#[test]
fn test_from_str_cstr_success() {
common::from_str::test_from_str_cstr_success::<Arc<CStr>>();
}
#[test]
fn test_from_str_cstr_error() {
common::from_str::test_from_str_cstr_error::<Arc<CStr>>();
}
#[test]
fn test_as_ref_cstr_flex_str() {
common::as_ref::test_as_ref_cstr_flex_str::<Arc<CStr>>(c"test");
}
#[cfg(feature = "zeroize")]
#[test]
fn test_zeroize_inlined_cstr() {
common::zeroize::test_zeroize_inlined::<CStr, Arc<CStr>>(c"test");
}
#[cfg(feature = "zeroize")]
#[test]
fn test_zeroize_borrowed_cstr() {
common::zeroize::test_zeroize_borrowed::<CStr, Arc<CStr>>(c"test");
}
#[cfg(feature = "zeroize")]
#[test]
fn test_zeroize_ref_counted_cstr() {
common::zeroize::test_zeroize_ref_counted::<CStr, Arc<CStr>>(Arc::from(c"test"));
}
#[cfg(feature = "zeroize")]
#[test]
fn test_zeroize_ref_counted_shared_cstr() {
common::zeroize::test_zeroize_ref_counted_shared::<CStr, Arc<CStr>>(Arc::from(c"test"));
}
#[cfg(feature = "zeroize")]
#[test]
fn test_zeroize_boxed_cstr() {
common::zeroize::test_zeroize_boxed::<CStr, Arc<CStr>>(c"test");
}
#[cfg(feature = "zeroize")]
#[test]
fn test_zeroize_inline_bytes_cleared_cstr() {
common::zeroize::test_zeroize_inline_bytes_cleared::<CStr>(c"test");
}