File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,17 @@ fn throws_into_key_value() -> Result<(), String> {
77
77
Ok ( ( ) )
78
78
}
79
79
80
+ fn throws_into_multiple_key_value_pairs ( ) -> Result < ( ) , String > {
81
+ throw ! (
82
+ Err ( "some static string" ) ,
83
+ "key" => "value" ,
84
+ "key2" => "value2" ,
85
+ "key3" => "value3" ,
86
+ "key4" => "value4" ,
87
+ ) ;
88
+ Ok ( ( ) )
89
+ }
90
+
80
91
#[ test]
81
92
fn test_static_message ( ) {
82
93
let error = throw_static_message ( ) . unwrap_err ( ) ;
@@ -170,3 +181,17 @@ fn test_throws_into_key_value() {
170
181
error
171
182
)
172
183
}
184
+
185
+ #[ test]
186
+ fn test_throws_into_multiple_key_value_pairs ( ) {
187
+ let error = throws_into_multiple_key_value_pairs ( ) . unwrap_err ( ) ;
188
+ assert_matches ! (
189
+ r#"Error: some static string
190
+ key4: value4
191
+ key3: value3
192
+ key2: value2
193
+ key: value
194
+ at [0-9]+:[0-9] in exceptions_work \([a-z/._-]+\)"# ,
195
+ error
196
+ )
197
+ }
You can’t perform that action at this time.
0 commit comments