@@ -221,12 +221,12 @@ mod test {
221
221
) ]
222
222
#[ test_case( "" , Ok ( CacheConfig { local: CacheActions { read: false , write: false } , remote: CacheActions { read: false , write: false } } ) ; "empty"
223
223
) ]
224
- #[ test_case( "local:r,local:w" , Err ( Error :: DuplicateKeys { text: "local:r,local:w" . to_string( ) , key: "local" , span: Some ( SourceSpan :: new( 8_usize . into( ) , 5_usize . into ( ) ) ) } ) ; "duplicate local key"
224
+ #[ test_case( "local:r,local:w" , Err ( Error :: DuplicateKeys { text: "local:r,local:w" . to_string( ) , key: "local" , span: Some ( SourceSpan :: new( 8_usize . into( ) , 5_usize ) ) } ) ; "duplicate local key"
225
225
) ]
226
- #[ test_case( "local:rr" , Err ( Error :: DuplicateActions { text: "local:rr" . to_string( ) , action: "r (read)" , span: Some ( SourceSpan :: new( 6_usize . into( ) , 5_usize . into ( ) ) ) } ) ; "duplicate action" ) ]
227
- #[ test_case( "remote:r,local=rx" , Err ( Error :: InvalidCacheTypeAndAction { text: "remote:r,local=rx" . to_string( ) , pair: "local=rx" . to_string( ) , span: Some ( SourceSpan :: new( 9_usize . into( ) , 8_usize . into ( ) ) ) } ) ; "invalid key action pair" ) ]
228
- #[ test_case( "local:rx" , Err ( Error :: InvalidCacheAction { c: 'x' , text: "local:rx" . to_string( ) , span: Some ( SourceSpan :: new( 6_usize . into( ) , 5_usize . into ( ) ) ) } ) ; "invalid action" ) ]
229
- #[ test_case( "file:r" , Err ( Error :: InvalidCacheType { s: "file" . to_string( ) , text: "file:r" . to_string( ) , span: Some ( SourceSpan :: new( 0_usize . into( ) , 4_usize . into ( ) ) ) } ) ; "invalid cache type" ) ]
226
+ #[ test_case( "local:rr" , Err ( Error :: DuplicateActions { text: "local:rr" . to_string( ) , action: "r (read)" , span: Some ( SourceSpan :: new( 6_usize . into( ) , 5_usize ) ) } ) ; "duplicate action" ) ]
227
+ #[ test_case( "remote:r,local=rx" , Err ( Error :: InvalidCacheTypeAndAction { text: "remote:r,local=rx" . to_string( ) , pair: "local=rx" . to_string( ) , span: Some ( SourceSpan :: new( 9_usize . into( ) , 8_usize ) ) } ) ; "invalid key action pair" ) ]
228
+ #[ test_case( "local:rx" , Err ( Error :: InvalidCacheAction { c: 'x' , text: "local:rx" . to_string( ) , span: Some ( SourceSpan :: new( 6_usize . into( ) , 5_usize ) ) } ) ; "invalid action" ) ]
229
+ #[ test_case( "file:r" , Err ( Error :: InvalidCacheType { s: "file" . to_string( ) , text: "file:r" . to_string( ) , span: Some ( SourceSpan :: new( 0_usize . into( ) , 4_usize ) ) } ) ; "invalid cache type" ) ]
230
230
fn test_cache_config ( s : & str , expected : Result < CacheConfig , Error > ) {
231
231
assert_eq ! ( CacheConfig :: from_str( s) , expected) ;
232
232
}
0 commit comments