Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ljeub-pometry committed Jul 2, 2024
1 parent 27fd5d4 commit 1a78f5b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test_rust_disk_storage_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
runs-on: '${{ matrix.os }}'
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
RUST_BACKTRACE: 1
strategy:
matrix:
include:
Expand Down
2 changes: 1 addition & 1 deletion raphtory-cypher/src/executor/table_provider/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl EdgeListTableProvider {

fn lift_nested_arrow_schema(graph: &DiskGraph, layer_id: usize) -> Result<Arc<Schema>, ExecError> {
let arrow2_fields = graph.as_ref().layer(layer_id).edges_data_type();
let a2_dt = crate::arrow2::datatypes::ArrowDataType::Struct(arrow2_fields.clone());
let a2_dt = crate::arrow2::datatypes::ArrowDataType::Struct(arrow2_fields.to_vec());
let a_dt: DataType = a2_dt.into();
let schema = match a_dt {
DataType::Struct(fields) => {
Expand Down
55 changes: 55 additions & 0 deletions raphtory/src/disk_graph/graph_impl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,61 @@ mod storage_tests {
inner_merge_test(&[], &[])
}

#[test]
fn test_one_empty_graph() {
inner_merge_test(&[], &[(0, 0, 0)])
}

#[test]
fn inbounds_not_merging() {
inner_merge_test(&[], &[(0, 0, 0), (0, 0, 1), (0, 0, 2)])
}

#[test]
fn inbounds_not_merging_take2() {
inner_merge_test(
&[(0, 0, 2)],
&[
(0, 1, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
(0, 0, 0),
],
)
}

#[test]
fn offsets_panic_overflow() {
inner_merge_test(
&[
(0, 0, 4),
(0, 0, 4),
(0, 0, 0),
(0, 0, 4),
(0, 1, 2),
(0, 3, 4),
],
&[(0, 0, 5), (0, 2, 0)],
)
}

#[test]
fn inbounds_not_merging_take3() {
inner_merge_test(
&[
(0, 0, 4),
(0, 0, 4),
(0, 0, 0),
(0, 0, 4),
(0, 1, 2),
(0, 3, 4),
],
&[(0, 0, 3), (0, 0, 4), (0, 2, 2), (0, 0, 5), (0, 0, 6)],
)
}
#[test]
fn test_merge_1_edge() {
let g1 = Graph::new();
Expand Down

0 comments on commit 1a78f5b

Please sign in to comment.