surrealpatch/lib/tests/expression.rs

26 lines
423 B
Rust
Raw Normal View History

mod helpers;
use helpers::Test;
use surrealdb::err::Error;
#[tokio::test]
2024-08-20 11:42:06 +00:00
async fn expr_modulo() -> Result<(), Error> {
Test::new("8 % 3").await?.expect_val("2")?;
Ok(())
}
2024-08-20 11:42:06 +00:00
#[tokio::test]
async fn expr_value_in_range() -> Result<(), Error> {
Test::new(
"
1 in 1..2;
'a' in 'a'..'b';
0 in 1..2;
",
)
.await?
.expect_val("true")?
.expect_val("true")?
.expect_val("false")?;
Ok(())
}