babycat 0.0.14

An audio decoding and manipulation library, with bindings for C, Python, and WebAssembly.
//! Custom assertions and other testing utilities.
#![allow(dead_code)]

use std::convert::AsRef;
use std::fmt::Debug;

/// Assert that an object's [`std::fmt::Debug`] output is equal to a specific value.
///
/// # Panics
/// This function is an assertion, therefore it might panic.
///
#[track_caller]
#[inline]
pub fn assert_debug<T: Debug, S: AsRef<str>>(t: &T, dbg_str: S) {
    assert_eq!(format!("{:?}", t), dbg_str.as_ref(),);
}