Skip to content

Commit

Permalink
ADded some more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed May 1, 2024
1 parent bebfdb5 commit 4323428
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/initializeSparseMatrixFromHdf5.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ test("initialization from HDF5 works correctly with dense inputs", () => {
// Freeing.
mat.free();
mat2.free();
mat3.free();
})

test("dense initialization from HDF5 works correctly with forced integers", () => {
Expand Down Expand Up @@ -229,6 +230,7 @@ test("initialization from HDF5 works correctly with H5AD inputs", () => {
// Freeing.
mat.free();
mat2.free();
mat3.free();
})

test("initialization from HDF5 works correctly with forced integers", () => {
Expand Down Expand Up @@ -272,9 +274,17 @@ test("initialization from HDF5 works correctly with forced integers", () => {
}
}

// Using raw access.
var mat3 = scran.initializeSparseMatrixFromHdf5SparseMatrix(path, "foobar", nr, nc, true, { forceInteger: true, layered: true });
expect(mat3.numberOfRows()).toBe(nr);
expect(mat3.numberOfColumns()).toBe(nc);
expect(compare.equalArrays(mat3.row(0), mat1.row(0))).toBe(true);
expect(compare.equalArrays(mat3.column(0), mat1.column(0))).toBe(true);

// Freeing.
mat1.free();
mat2.free();
mat3.free();
})

test("initialization from HDF5 works correctly with subsetting", () => {
Expand Down

0 comments on commit 4323428

Please sign in to comment.