File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -1875,6 +1875,57 @@ genome6 26.697144
18751875 . unwrap ( ) ;
18761876 }
18771877
1878+ #[ test]
1879+ fn test_lr_hq_single_sample_two_zero_means ( ) {
1880+ Assert :: main_binary ( )
1881+ . with_args ( & [
1882+ "contig" ,
1883+ "-m" ,
1884+ "mean" ,
1885+ "-p" ,
1886+ "minimap2-lr-hq" ,
1887+ "--single" ,
1888+ "tests/data/2seqs.fasta" ,
1889+ "-r" ,
1890+ "tests/data/7seqs.fna" ,
1891+ ] )
1892+ . succeeds ( )
1893+ . stdout ( )
1894+ . satisfies (
1895+ |observed| {
1896+ let mut lines = observed. lines ( ) ;
1897+ let header = lines. next ( ) . unwrap_or ( "" ) ;
1898+ assert ! (
1899+ header. starts_with( "Contig\t " ) ,
1900+ "Unexpected header: {header}" ,
1901+ header = header
1902+ ) ;
1903+
1904+ let mut total = 0 ;
1905+ let mut zero_means = 0 ;
1906+ for line in lines {
1907+ let fields: Vec < & str > = line. split ( '\t' ) . collect ( ) ;
1908+ assert_eq ! (
1909+ fields. len( ) ,
1910+ 2 ,
1911+ "Expected contig and mean columns in '{line}'"
1912+ ) ;
1913+ let mean: f64 = fields[ 1 ] . parse ( ) . unwrap ( ) ;
1914+ if mean == 0.0 {
1915+ zero_means += 1 ;
1916+ }
1917+ total += 1 ;
1918+ }
1919+
1920+ assert_eq ! ( total, 7 , "Expected 7 contig rows" ) ;
1921+ assert_eq ! ( zero_means, 2 , "Expected 2 zero-mean contigs" ) ;
1922+ true
1923+ } ,
1924+ "unexpected output" ,
1925+ )
1926+ . unwrap ( ) ;
1927+ }
1928+
18781929 #[ test]
18791930 fn test_ont_two_samples ( ) {
18801931 // Also tests that -t is being set when minimap2 indexing
You can’t perform that action at this time.
0 commit comments