1
- //! This module provides the TestCaseRunner and TestCase trait for running and defining test cases.
1
+ //! This module provides the ` TestCaseRunner` and ` TestCase` trait for running and defining test cases.
2
2
//! It handles setup, execution, and cleanup of test environments.
3
3
4
4
use std:: {
@@ -36,7 +36,7 @@ use crate::{
36
36
pub struct TestCaseRunner < T : TestCase > ( T ) ;
37
37
38
38
impl < T : TestCase > TestCaseRunner < T > {
39
- /// Creates a new TestCaseRunner with the given test case.
39
+ /// Creates a new ` TestCaseRunner`` with the given test case.
40
40
pub fn new ( test_case : T ) -> Self {
41
41
Self ( test_case)
42
42
}
@@ -85,7 +85,7 @@ impl<T: TestCase> TestCaseRunner<T> {
85
85
86
86
if let Err ( _) | Ok ( Err ( _) ) = result {
87
87
if let Err ( e) = f. dump_log ( ) {
88
- eprintln ! ( "Error dumping log: {}" , e ) ;
88
+ eprintln ! ( "Error dumping log: {e}" ) ;
89
89
}
90
90
}
91
91
@@ -100,8 +100,7 @@ impl<T: TestCase> TestCaseRunner<T> {
100
100
Err ( panic_error) => {
101
101
let panic_msg = panic_error
102
102
. downcast_ref :: < String > ( )
103
- . map ( |s| s. to_string ( ) )
104
- . unwrap_or_else ( || "Unknown panic" . to_string ( ) ) ;
103
+ . map_or_else ( || "Unknown panic" . to_string ( ) , ToString :: to_string) ;
105
104
bail ! ( panic_msg)
106
105
}
107
106
}
@@ -138,7 +137,7 @@ impl<T: TestCase> TestCaseRunner<T> {
138
137
env : env. bitcoin ( ) . clone ( ) ,
139
138
idx : i,
140
139
..bitcoin. clone ( )
141
- } )
140
+ } ) ;
142
141
}
143
142
144
143
// Target first bitcoin node as DA for now
@@ -158,7 +157,7 @@ impl<T: TestCase> TestCaseRunner<T> {
158
157
..da_config. clone ( )
159
158
} ,
160
159
storage : StorageConfig {
161
- path : dbs_dir. join ( format ! ( "{}-db" , node_kind ) ) ,
160
+ path : dbs_dir. join ( format ! ( "{node_kind }-db" ) ) ,
162
161
db_max_open_files : None ,
163
162
} ,
164
163
rpc : RpcConfig {
@@ -193,7 +192,7 @@ impl<T: TestCase> TestCaseRunner<T> {
193
192
..da_config. clone ( )
194
193
} ,
195
194
storage : StorageConfig {
196
- path : dbs_dir. join ( format ! ( "{}-db" , node_kind ) ) ,
195
+ path : dbs_dir. join ( format ! ( "{node_kind }-db" ) ) ,
197
196
db_max_open_files : None ,
198
197
} ,
199
198
rpc : RpcConfig {
@@ -219,7 +218,7 @@ impl<T: TestCase> TestCaseRunner<T> {
219
218
..da_config. clone ( )
220
219
} ,
221
220
storage : StorageConfig {
222
- path : dbs_dir. join ( format ! ( "{}-db" , node_kind ) ) ,
221
+ path : dbs_dir. join ( format ! ( "{node_kind }-db" ) ) ,
223
222
db_max_open_files : None ,
224
223
} ,
225
224
rpc : RpcConfig {
0 commit comments