Fix unchecked test.

This commit is contained in:
Stephen Chung 2021-04-25 15:27:43 +08:00
parent 24c01f6f9f
commit ed18b3f32a

View File

@ -8,7 +8,7 @@ use rhai::FLOAT;
use rust_decimal::Decimal; use rust_decimal::Decimal;
#[test] #[test]
fn test_for() -> Result<(), Box<EvalAltResult>> { fn test_for_loop() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new(); let engine = Engine::new();
#[cfg(not(feature = "no_index"))] #[cfg(not(feature = "no_index"))]
@ -59,6 +59,7 @@ fn test_for() -> Result<(), Box<EvalAltResult>> {
25 25
); );
#[cfg(not(feature = "unchecked"))]
assert_eq!( assert_eq!(
engine.eval::<INT>( engine.eval::<INT>(
" "
@ -70,6 +71,7 @@ fn test_for() -> Result<(), Box<EvalAltResult>> {
0 0
); );
#[cfg(not(feature = "unchecked"))]
assert_eq!( assert_eq!(
engine.eval::<INT>( engine.eval::<INT>(
" "
@ -105,6 +107,7 @@ fn test_for() -> Result<(), Box<EvalAltResult>> {
25.0 25.0
); );
#[cfg(not(feature = "unchecked"))]
assert_eq!( assert_eq!(
engine.eval::<FLOAT>( engine.eval::<FLOAT>(
" "
@ -116,6 +119,7 @@ fn test_for() -> Result<(), Box<EvalAltResult>> {
0.0 0.0
); );
#[cfg(not(feature = "unchecked"))]
assert_eq!( assert_eq!(
engine.eval::<FLOAT>( engine.eval::<FLOAT>(
" "
@ -153,6 +157,7 @@ fn test_for() -> Result<(), Box<EvalAltResult>> {
Decimal::from(25) Decimal::from(25)
); );
#[cfg(not(feature = "unchecked"))]
assert_eq!( assert_eq!(
engine.eval::<Decimal>( engine.eval::<Decimal>(
" "
@ -164,6 +169,7 @@ fn test_for() -> Result<(), Box<EvalAltResult>> {
Decimal::from(0) Decimal::from(0)
); );
#[cfg(not(feature = "unchecked"))]
assert_eq!( assert_eq!(
engine.eval::<Decimal>( engine.eval::<Decimal>(
" "