MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / assert_numeric_range

Method assert_numeric_range

graphlite/tests/function_tests.rs:23–43  ·  view source on GitHub ↗
(&self, query: &str, column: &str, min: f64, max: f64)

Source from the content-addressed store, hash-verified

21
22impl TestFixtureExtensions for TestFixture {
23 fn assert_numeric_range(&self, query: &str, column: &str, min: f64, max: f64) -> f64 {
24 let result = self.assert_query_succeeds(query);
25 assert_eq!(result.rows.len(), 1);
26
27 let value = result.rows[0]
28 .values
29 .get(column)
30 .expect("Column should exist");
31 if let Value::Number(num) = value {
32 assert!(
33 *num >= min && *num <= max,
34 "Value {} should be between {} and {}",
35 num,
36 min,
37 max
38 );
39 *num
40 } else {
41 panic!("Expected numeric value, got {:?}", value);
42 }
43 }
44}
45
46// ==============================================================================

Calls 2

assert_query_succeedsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected