@@ -52,47 +52,40 @@ impl Feature {
52
52
mod tests {
53
53
use super :: * ;
54
54
55
- fn build_feature ( ) -> Result < Feature , noodles:: core:: position:: TryFromIntError > {
56
- Ok ( Feature :: new (
57
- 0 ,
58
- Position :: try_from ( 8 ) ?,
59
- Position :: try_from ( 13 ) ?,
60
- gff:: feature:: record:: Strand :: Forward ,
61
- ) )
55
+ const START : Position = Position :: new ( 8 ) . unwrap ( ) ;
56
+ const END : Position = Position :: new ( 13 ) . unwrap ( ) ;
57
+
58
+ fn build_feature ( ) -> Feature {
59
+ Feature :: new ( 0 , START , END , gff:: feature:: record:: Strand :: Forward )
62
60
}
63
61
64
62
#[ test]
65
- fn test_reference_sequence_id ( ) -> Result < ( ) , noodles :: core :: position :: TryFromIntError > {
66
- let feature = build_feature ( ) ? ;
63
+ fn test_reference_sequence_id ( ) {
64
+ let feature = build_feature ( ) ;
67
65
assert_eq ! ( feature. reference_sequence_id( ) , 0 ) ;
68
- Ok ( ( ) )
69
66
}
70
67
71
68
#[ test]
72
- fn test_start ( ) -> Result < ( ) , noodles:: core:: position:: TryFromIntError > {
73
- let feature = build_feature ( ) ?;
74
- assert_eq ! ( feature. start( ) , Position :: try_from( 8 ) ?) ;
75
- Ok ( ( ) )
69
+ fn test_start ( ) {
70
+ let feature = build_feature ( ) ;
71
+ assert_eq ! ( feature. start( ) , START ) ;
76
72
}
77
73
78
74
#[ test]
79
- fn test_end ( ) -> Result < ( ) , noodles:: core:: position:: TryFromIntError > {
80
- let feature = build_feature ( ) ?;
81
- assert_eq ! ( feature. end( ) , Position :: try_from( 13 ) ?) ;
82
- Ok ( ( ) )
75
+ fn test_end ( ) {
76
+ let feature = build_feature ( ) ;
77
+ assert_eq ! ( feature. end( ) , END ) ;
83
78
}
84
79
85
80
#[ test]
86
- fn test_strand ( ) -> Result < ( ) , noodles :: core :: position :: TryFromIntError > {
87
- let feature = build_feature ( ) ? ;
81
+ fn test_strand ( ) {
82
+ let feature = build_feature ( ) ;
88
83
assert_eq ! ( feature. strand( ) , gff:: feature:: record:: Strand :: Forward ) ;
89
- Ok ( ( ) )
90
84
}
91
85
92
86
#[ test]
93
- fn test_length ( ) -> Result < ( ) , noodles :: core :: position :: TryFromIntError > {
94
- let feature = build_feature ( ) ? ;
87
+ fn test_length ( ) {
88
+ let feature = build_feature ( ) ;
95
89
assert_eq ! ( feature. length( ) , 6 ) ;
96
- Ok ( ( ) )
97
90
}
98
91
}
0 commit comments