1818//!
1919//! Results are compared with Rust built-in `format_args` macro.
2020
21- // TODO: tests fail for `+nightly-2025-05-30` and older.
22- // Remove `#[cfg(not(miri))]` once updated in CI.
23- // https://github.com/eclipse-score/baselibs_rust/issues/31
24-
2521mod utils;
2622
2723use crate :: utils:: StringWriter ;
@@ -63,39 +59,34 @@ fn test_escaped_braces() {
6359}
6460
6561#[ test]
66- #[ cfg( not( miri) ) ]
6762fn test_single_placeholder ( ) {
6863 let mw_log_args = mw_log_format_args ! ( "{}" , 123 ) ;
6964 let core_fmt_args = format_args ! ( "{}" , 123 ) ;
7065 common_format_args_test ( mw_log_args, core_fmt_args, 1 , "123" ) ;
7166}
7267
7368#[ test]
74- #[ cfg( not( miri) ) ]
7569fn test_mixed_literals_and_placeholders ( ) {
7670 let mw_log_args = mw_log_format_args ! ( "test_{}_string" , 321 ) ;
7771 let core_fmt_args = format_args ! ( "test_{}_string" , 321 ) ;
7872 common_format_args_test ( mw_log_args, core_fmt_args, 3 , "test_321_string" ) ;
7973}
8074
8175#[ test]
82- #[ cfg( not( miri) ) ]
8376fn test_arg_index ( ) {
8477 let mw_log_args = mw_log_format_args ! ( "test_{2}_{1}_{0}" , 123 , 234 , 345 ) ;
8578 let core_fmt_args = format_args ! ( "test_{2}_{1}_{0}" , 123 , 234 , 345 ) ;
8679 common_format_args_test ( mw_log_args, core_fmt_args, 6 , "test_345_234_123" ) ;
8780}
8881
8982#[ test]
90- #[ cfg( not( miri) ) ]
9183fn test_arg_pos_and_index ( ) {
9284 let mw_log_args = mw_log_format_args ! ( "test_{2}_{}_{1}_{}_{0}" , 123 , 234 , 345 ) ;
9385 let core_fmt_args = format_args ! ( "test_{2}_{}_{1}_{}_{0}" , 123 , 234 , 345 ) ;
9486 common_format_args_test ( mw_log_args, core_fmt_args, 10 , "test_345_123_234_234_123" ) ;
9587}
9688
9789#[ test]
98- #[ cfg( not( miri) ) ]
9990fn test_arg_name ( ) {
10091 let x1 = 123 ;
10192 let x2 = 234 ;
@@ -109,7 +100,6 @@ fn test_arg_name() {
109100}
110101
111102#[ test]
112- #[ cfg( not( miri) ) ]
113103fn test_arg_name_alias ( ) {
114104 let x1 = 123 ;
115105 let x2 = 234 ;
@@ -120,7 +110,6 @@ fn test_arg_name_alias() {
120110}
121111
122112#[ test]
123- #[ cfg( not( miri) ) ]
124113fn test_arg_pos_and_name ( ) {
125114 let x1 = 123 ;
126115 let x2 = 234 ;
@@ -134,7 +123,6 @@ fn test_arg_pos_and_name() {
134123}
135124
136125#[ test]
137- #[ cfg( not( miri) ) ]
138126fn test_arg_mixed ( ) {
139127 let x1 = 111 ;
140128 let x2 = 222 ;
@@ -144,7 +132,6 @@ fn test_arg_mixed() {
144132}
145133
146134#[ test]
147- #[ cfg( not( miri) ) ]
148135fn test_format_spec_empty ( ) {
149136 let args = mw_log_format_args ! ( "{:}" , 123 ) ;
150137
@@ -166,7 +153,6 @@ fn test_format_spec_empty() {
166153}
167154
168155#[ test]
169- #[ cfg( not( miri) ) ]
170156fn test_format_spec_all ( ) {
171157 let args = mw_log_format_args ! ( "{:c<-#0333.555x}" , 123 ) ;
172158
@@ -188,7 +174,6 @@ fn test_format_spec_all() {
188174}
189175
190176#[ test]
191- #[ cfg( not( miri) ) ]
192177fn test_format_spec_debug ( ) {
193178 let args = mw_log_format_args ! ( "{:#X?}" , 123 ) ;
194179
@@ -210,7 +195,6 @@ fn test_format_spec_debug() {
210195}
211196
212197#[ test]
213- #[ cfg( not( miri) ) ]
214198fn test_format_spec_display_hint_octal ( ) {
215199 let args = mw_log_format_args ! ( "{:o}" , 123 ) ;
216200
@@ -224,7 +208,6 @@ fn test_format_spec_display_hint_octal() {
224208}
225209
226210#[ test]
227- #[ cfg( not( miri) ) ]
228211fn test_format_spec_display_hint_lower_hex ( ) {
229212 let args = mw_log_format_args ! ( "{:x}" , 123 ) ;
230213
@@ -238,7 +221,6 @@ fn test_format_spec_display_hint_lower_hex() {
238221}
239222
240223#[ test]
241- #[ cfg( not( miri) ) ]
242224fn test_format_spec_display_hint_upper_hex ( ) {
243225 let args = mw_log_format_args ! ( "{:X}" , 123 ) ;
244226
@@ -252,7 +234,6 @@ fn test_format_spec_display_hint_upper_hex() {
252234}
253235
254236#[ test]
255- #[ cfg( not( miri) ) ]
256237fn test_format_spec_display_hint_pointer ( ) {
257238 let args = mw_log_format_args ! ( "{:p}" , 123 ) ;
258239
@@ -266,7 +247,6 @@ fn test_format_spec_display_hint_pointer() {
266247}
267248
268249#[ test]
269- #[ cfg( not( miri) ) ]
270250fn test_format_spec_display_hint_binary ( ) {
271251 let args = mw_log_format_args ! ( "{:b}" , 123 ) ;
272252
@@ -280,7 +260,6 @@ fn test_format_spec_display_hint_binary() {
280260}
281261
282262#[ test]
283- #[ cfg( not( miri) ) ]
284263fn test_format_spec_display_hint_lower_exp ( ) {
285264 let args = mw_log_format_args ! ( "{:e}" , 123 ) ;
286265
@@ -294,7 +273,6 @@ fn test_format_spec_display_hint_lower_exp() {
294273}
295274
296275#[ test]
297- #[ cfg( not( miri) ) ]
298276fn test_format_spec_display_hint_upper_exp ( ) {
299277 let args = mw_log_format_args ! ( "{:E}" , 123 ) ;
300278
0 commit comments