MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / test_impossible_bounds_no_panic

Function test_impossible_bounds_no_panic

crates/core/src/sql/execute.rs:1473–1497  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1471
1472 #[test]
1473 fn test_impossible_bounds_no_panic() -> ResultTest<()> {
1474 let db = TestDB::durable()?;
1475
1476 let table_id = db
1477 .create_table_for_test("test", &[("x", AlgebraicType::I32)], &[ColId(0)])
1478 .unwrap();
1479
1480 with_auto_commit(&db, |tx| {
1481 for i in 0..1000i32 {
1482 insert(&db, tx, table_id, &product!(i)).unwrap();
1483 }
1484 Ok::<(), DBError>(())
1485 })
1486 .unwrap();
1487
1488 let result = run_for_testing(&db, "select * from test where x > 5 and x < 5").unwrap();
1489 assert!(result.is_empty());
1490
1491 let result = run_for_testing(&db, "select * from test where x >= 5 and x < 4").unwrap();
1492 assert!(result.is_empty(), "Expected no rows but found {result:#?}");
1493
1494 let result = run_for_testing(&db, "select * from test where x > 5 and x <= 4").unwrap();
1495 assert!(result.is_empty());
1496 Ok(())
1497 }
1498
1499 #[test]
1500 fn test_multi_column_two_ranges() -> ResultTest<()> {

Callers

nothing calls this directly

Calls 7

ColIdClass · 0.85
with_auto_commitFunction · 0.85
run_for_testingFunction · 0.85
create_table_for_testMethod · 0.80
insertFunction · 0.50
OkFunction · 0.50
unwrapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…