|
| 1 | +/* |
| 2 | + * SPDX-License-Identifier: MIT |
| 3 | + * Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved. |
| 4 | + */ |
| 5 | +use deep_causality_uncertain::SampledValue; |
| 6 | + |
| 7 | +#[test] |
| 8 | +fn test_sampled_value_float_display() { |
| 9 | + let val = SampledValue::Float(123.45); |
| 10 | + assert_eq!(format!("{}", val), "123.45"); |
| 11 | +} |
| 12 | + |
| 13 | +#[test] |
| 14 | +fn test_sampled_value_bool_display() { |
| 15 | + let val_true = SampledValue::Bool(true); |
| 16 | + assert_eq!(format!("{}", val_true), "true"); |
| 17 | + |
| 18 | + let val_false = SampledValue::Bool(false); |
| 19 | + assert_eq!(format!("{}", val_false), "false"); |
| 20 | +} |
| 21 | + |
| 22 | +#[test] |
| 23 | +fn test_sampled_value_float_debug() { |
| 24 | + let val = SampledValue::Float(123.45); |
| 25 | + assert_eq!(format!("{:?}", val), "Float(123.45)"); |
| 26 | +} |
| 27 | + |
| 28 | +#[test] |
| 29 | +fn test_sampled_value_bool_debug() { |
| 30 | + let val_true = SampledValue::Bool(true); |
| 31 | + assert_eq!(format!("{:?}", val_true), "Bool(true)"); |
| 32 | + |
| 33 | + let val_false = SampledValue::Bool(false); |
| 34 | + assert_eq!(format!("{:?}", val_false), "Bool(false)"); |
| 35 | +} |
| 36 | + |
| 37 | +#[test] |
| 38 | +fn test_sampled_value_float_clone() { |
| 39 | + let val = SampledValue::Float(123.45); |
| 40 | + let cloned_val = val; |
| 41 | + assert_eq!(val, cloned_val); |
| 42 | +} |
| 43 | + |
| 44 | +#[test] |
| 45 | +fn test_sampled_value_bool_clone() { |
| 46 | + let val = SampledValue::Bool(true); |
| 47 | + let cloned_val = val; |
| 48 | + assert_eq!(val, cloned_val); |
| 49 | +} |
| 50 | + |
| 51 | +#[test] |
| 52 | +fn test_sampled_value_float_copy() { |
| 53 | + let val = SampledValue::Float(123.45); |
| 54 | + let copied_val = val; // Copy happens implicitly |
| 55 | + assert_eq!(val, copied_val); |
| 56 | +} |
0 commit comments