| 775 | |
| 776 | #[test] |
| 777 | fn test_read_ordering() { |
| 778 | let read1 = Read { |
| 779 | name: "read1".to_string(), |
| 780 | cigar: PlotCigar(vec![]), |
| 781 | position: 20, |
| 782 | flags: 0, |
| 783 | mapq: 0, |
| 784 | row: None, |
| 785 | end_position: 120, |
| 786 | mpos: 100, |
| 787 | aux: AuxRecord(HashMap::new()), |
| 788 | raw_cigar: "100M".to_string(), |
| 789 | }; |
| 790 | |
| 791 | let read2 = Read { |
| 792 | name: "read2".to_string(), |
| 793 | cigar: PlotCigar(vec![]), |
| 794 | position: 40, |
| 795 | flags: 0, |
| 796 | mapq: 0, |
| 797 | row: None, |
| 798 | end_position: 140, |
| 799 | mpos: 120, |
| 800 | aux: AuxRecord(HashMap::new()), |
| 801 | raw_cigar: "100M".to_string(), |
| 802 | }; |
| 803 | |
| 804 | let mut reads = vec![read1, read2]; |
| 805 | reads.order(100).unwrap(); |
| 806 | assert_ne!(reads.first().unwrap().row, reads.last().unwrap().row); |
| 807 | } |
| 808 | |
| 809 | #[test] |
| 810 | fn test_read_ordering_with_max_read_depth() { |