Skip to content

Commit 9cea431

Browse files
committed
Updated error tests.
1 parent 9f417c3 commit 9cea431

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

deep_causality/tests/errors/error_tests.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) "2023" . Marvin Hansen <[email protected]> All rights reserved.
22

33
use deep_causality::errors::{ActionError, AdjustmentError, ContextIndexError, PropagateError, UpdateError};
4-
use deep_causality::prelude::{BuildError, CausalityGraphError, CausalityError};
4+
use deep_causality::prelude::{BuildError, CausalityGraphError, CausalityError, CausalGraphIndexError};
55

66
#[test]
77
fn test_build_error() {
@@ -32,6 +32,15 @@ fn test_context_index_error() {
3232

3333
}
3434

35+
#[test]
36+
fn test_causal_graph_index_error() {
37+
let result: Result<usize, CausalGraphIndexError> = Err(CausalGraphIndexError(
38+
format!("unexpected cause"),
39+
));
40+
let error = result.unwrap_err();
41+
assert_eq!(error.to_string(), format!("CausalGraphIndexError: unexpected cause"));
42+
}
43+
3544
#[test]
3645
fn test_causality_error() {
3746
let result: Result<usize, CausalityError> = Err(CausalityError(

0 commit comments

Comments
 (0)