csdif-core 0.1.3

Core library for modeling, validating, and transforming CSDIF data
Documentation
// SPDX-License-Identifier: MIT

//! Unit tests for the CsdifError type and its Display implementation.

use csdif_core::error::CsdifError;

#[test]
fn test_display_validation_error() {
    let err = CsdifError::Validation("Missing field".into());
    assert_eq!(format!("{}", err), "Validation error: Missing field");
}

#[test]
fn test_display_transformation_error() {
    let err = CsdifError::Transformation("Invalid input".into());
    assert_eq!(format!("{}", err), "Transformation error: Invalid input");
}

#[test]
fn test_display_generic_error() {
    let err = CsdifError::Other("Something went wrong".into());
    assert_eq!(format!("{}", err), "Error: Something went wrong");
}