File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -52,17 +52,30 @@ impl AcceptRanges {
5252
5353#[ cfg( test) ]
5454mod tests {
55+ use super :: super :: test_decode;
5556 use super :: * ;
5657
58+ fn accept_ranges ( s : & str ) -> AcceptRanges {
59+ test_decode ( & [ s] ) . unwrap ( )
60+ }
61+
62+ #[ test]
63+ fn bytes_constructor ( ) {
64+ assert_eq ! ( accept_ranges( "bytes" ) , AcceptRanges :: bytes( ) ) ;
65+ }
66+
67+ #[ test]
68+ fn is_bytes_method_successful_with_bytes_ranges ( ) {
69+ assert ! ( accept_ranges( "bytes" ) . is_bytes( ) ) ;
70+ }
71+
5772 #[ test]
58- fn bytes ( ) {
59- let bytes_range = AcceptRanges :: bytes ( ) ;
60- assert ! ( bytes_range. is_bytes( ) ) ;
73+ fn is_bytes_method_successful_with_bytes_ranges_by_constructor ( ) {
74+ assert ! ( AcceptRanges :: bytes( ) . is_bytes( ) ) ;
6175 }
6276
6377 #[ test]
64- fn bytes_fails ( ) {
65- let none_range = AcceptRanges ( HeaderValue :: from_static ( "none" ) . into ( ) ) ;
66- assert ! ( !none_range. is_bytes( ) ) ;
78+ fn is_bytes_method_failed_with_not_bytes_ranges ( ) {
79+ assert ! ( !accept_ranges( "dummy" ) . is_bytes( ) ) ;
6780 }
6881}
You can’t perform that action at this time.
0 commit comments