6 releases
Uses new Rust 2024
new 0.1.5 | Apr 13, 2025 |
---|---|
0.1.4 | Apr 13, 2025 |
#189 in Testing
28 downloads per month
Used in graph-api-benches
290KB
5.5K
SLoC
Graph-API Test Suite
Welcome to graph-api-test — your friendly companion for ensuring your graph implementation behaves exactly as expected!
Implementing the Graph-API traits for your custom graph structure? This comprehensive test suite takes the guesswork out of compatibility testing, giving you confidence that your graph behaves correctly.
Effortless Testing
Testing your graph implementation couldn't be easier:
#[cfg(test)]
mod test {
use graph_api_test::test_suite;
// One line to test everything!
test_suite!(YourGraph::new());
}
With this simple macro, you'll validate that your graph implementation properly supports all the operations and behaviors expected by the Graph-API ecosystem. No need to write tedious test cases for each feature!
Feature-Specific Testing
Implementing only a subset of Graph-API's optional capabilities? No problem! Simply include the features that match your implementation:
[dev-dependencies]
graph-api-test = { version = "0.1.0", features = [
"vertex-label-index",
"edge-label-index",
"vertex-range-index"
]}
Available Feature Tests
vertex-label-index
: Label-based vertex lookupsedge-label-index
: Label-based edge traversalsvertex-hash-index
: Hash-indexed vertex propertiesedge-hash-index
: Hash-indexed edge propertiesvertex-range-index
: Range queries for vertex propertiesedge-range-index
: Range queries for edge propertiesvertex-full-text-index
: Full-text search for vertex propertiesgraph-clear
: Graph clearing operations
Standard Test Graph
Most tests use a consistent, well-defined graph with:
- Vertices: People (Bryn, Julia), Projects (GraphApi), and Technologies (Rust)
- Edges: Knowledge relationships, creation attribution, and technology connections
This standardized structure ensures that all graph implementations are tested against the same scenarios.
Writing Custom Tests
Need to test specific aspects of your implementation? The suite provides helpful utilities:
- Ready-to-use test graph population
- Element comparison helpers
- Reference tracking for standard test elements
- Test patterns for different graph features
Make your graph implementation rock-solid with graph-api-test!
Learn more in the graph-api book.
Dependencies
~7–20MB
~219K SLoC