Skip to content

Commit 9c4bfcc

Browse files
committed
init cargo tests
1 parent 64397a6 commit 9c4bfcc

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ mod alignmentsieve;
77
mod filehandler;
88
mod normalization;
99
mod calc;
10+
mod multibamsummary;
11+
mod test;
1012

1113
#[pymodule]
1214
fn hp(m: &Bound<'_, PyModule>) -> PyResult<()> {
1315
m.add_function(wrap_pyfunction!(bamcoverage::r_bamcoverage, m)?)?;
1416
m.add_function(wrap_pyfunction!(bamcompare::r_bamcompare, m)?)?;
1517
m.add_function(wrap_pyfunction!(computematrix::r_computematrix, m)?)?;
1618
m.add_function(wrap_pyfunction!(alignmentsieve::r_alignmentsieve, m)?)?;
19+
m.add_function(wrap_pyfunction!(multibamsummary::r_mbams, m)?)?;
1720
Ok(())
1821
}

src/test.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
use crate::calc::median;
2+
3+
#[cfg(test)]
4+
mod tests {
5+
use super::*;
6+
7+
#[test]
8+
fn test_median() {
9+
let v: Vec<u32> = vec![1,2,3,4,5];
10+
assert_eq!(median(v), 3.0);
11+
}
12+
}

0 commit comments

Comments
 (0)