Add no_position feature.
This commit is contained in:
@@ -206,7 +206,7 @@ fn test_map_json() -> Result<(), Box<EvalAltResult>> {
|
||||
assert!(matches!(
|
||||
*engine.parse_json(" 123", true).expect_err("should error"),
|
||||
EvalAltResult::ErrorParsing(ParseErrorType::MissingToken(token, _), pos)
|
||||
if token == "{" && pos.position() == Some(4)
|
||||
if token == "{"
|
||||
));
|
||||
|
||||
Ok(())
|
||||
|
@@ -49,6 +49,7 @@ fn test_optimizer_run() -> Result<(), Box<EvalAltResult>> {
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
#[cfg(not(feature = "no_position"))]
|
||||
#[test]
|
||||
fn test_optimizer_parse() -> Result<(), Box<EvalAltResult>> {
|
||||
let mut engine = Engine::new();
|
||||
|
@@ -60,7 +60,11 @@ fn test_print_debug() -> Result<(), Box<EvalAltResult>> {
|
||||
assert_eq!(logbook.read().unwrap()[0], "entry: 42");
|
||||
assert_eq!(
|
||||
logbook.read().unwrap()[1],
|
||||
r#"DEBUG of world at 1:19: "hello!""#
|
||||
if cfg!(not(feature = "no_position")) {
|
||||
r#"DEBUG of world at 1:19: "hello!""#
|
||||
} else {
|
||||
r#"DEBUG of world at none: "hello!""#
|
||||
}
|
||||
);
|
||||
|
||||
for entry in logbook.read().unwrap().iter() {
|
||||
|
@@ -14,7 +14,11 @@ fn test_string() -> Result<(), Box<EvalAltResult>> {
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<String>(" \"Test string: \\u2764\\\n hello, world!\"")?,
|
||||
"Test string: ❤ hello, world!"
|
||||
if cfg!(not(feature = "no_position")) {
|
||||
"Test string: ❤ hello, world!"
|
||||
} else {
|
||||
"Test string: ❤ hello, world!"
|
||||
}
|
||||
);
|
||||
assert_eq!(
|
||||
engine.eval::<String>(" `Test string: \\u2764\nhello,\\nworld!`")?,
|
||||
|
Reference in New Issue
Block a user