Fix tests.
This commit is contained in:
parent
c14fbdb14d
commit
68bd84417a
@ -239,8 +239,10 @@ impl Engine {
|
|||||||
engine.print = Box::new(|s| println!("{s}"));
|
engine.print = Box::new(|s| println!("{s}"));
|
||||||
engine.debug = Box::new(|s, source, pos| match (source, pos) {
|
engine.debug = Box::new(|s, source, pos| match (source, pos) {
|
||||||
(Some(source), crate::Position::NONE) => println!("{source} | {s}"),
|
(Some(source), crate::Position::NONE) => println!("{source} | {s}"),
|
||||||
|
#[cfg(not(feature = "no_position"))]
|
||||||
(Some(source), pos) => println!("{source} @ {pos:?} | {s}"),
|
(Some(source), pos) => println!("{source} @ {pos:?} | {s}"),
|
||||||
(None, crate::Position::NONE) => println!("{s}"),
|
(None, crate::Position::NONE) => println!("{s}"),
|
||||||
|
#[cfg(not(feature = "no_position"))]
|
||||||
(None, pos) => println!("{pos:?} | {s}"),
|
(None, pos) => println!("{pos:?} | {s}"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -231,10 +231,12 @@ fn test_for_loop() -> Result<(), Box<EvalAltResult>> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "no_index"))]
|
||||||
|
#[cfg(not(feature = "no_object"))]
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
engine.eval::<INT>(
|
engine.eval::<INT>(
|
||||||
r#"
|
r#"
|
||||||
let a = [123, 999, 42, 0, true, "hello", "world!", 987.6543];
|
let a = [123, 999, 42, 0, true, "hello", "world!"];
|
||||||
|
|
||||||
for (item, count) in a {
|
for (item, count) in a {
|
||||||
switch item.type_of() {
|
switch item.type_of() {
|
||||||
|
Loading…
Reference in New Issue
Block a user