Skip to content

Commit d592e9d

Browse files
committed
Increase test coverage.
1 parent d86dc3a commit d592e9d

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/token/display.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(tarpaulin_include))]
2+
13
use std::fmt;
24

35
use crate::{

tests/integration.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,3 +2544,33 @@ fn test_compare_different_numeric_types() {
25442544
assert_eq!(eval("1 >= 2"), Ok(false.into()));
25452545
assert_eq!(eval("1 >= 2.0"), Ok(false.into()));
25462546
}
2547+
2548+
#[test]
2549+
fn test_escape_sequences() {
2550+
assert_eq!(
2551+
eval("\"\\x\""),
2552+
Err(EvalexprError::IllegalEscapeSequence("\\x".to_string()))
2553+
);
2554+
assert_eq!(
2555+
eval("\"\\"),
2556+
Err(EvalexprError::IllegalEscapeSequence("\\".to_string()))
2557+
);
2558+
}
2559+
2560+
#[test]
2561+
fn test_unmatched_partial_tokens() {
2562+
assert_eq!(
2563+
eval("|"),
2564+
Err(EvalexprError::UnmatchedPartialToken {
2565+
first: PartialToken::VerticalBar,
2566+
second: None
2567+
})
2568+
);
2569+
}
2570+
2571+
#[test]
2572+
fn test_node_mutable_access() {
2573+
let mut node = build_operator_tree::<DefaultNumericTypes>("5").unwrap();
2574+
assert_eq!(node.children_mut().len(), 1);
2575+
assert_eq!(*node.operator_mut(), Operator::RootNode);
2576+
}

0 commit comments

Comments
 (0)