File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2814,6 +2814,8 @@ pub struct InitialBalanceFile {
2814
2814
2815
2815
#[ cfg( test) ]
2816
2816
mod tests {
2817
+ use std:: path:: Path ;
2818
+
2817
2819
use super :: * ;
2818
2820
2819
2821
#[ test]
@@ -3000,6 +3002,26 @@ mod tests {
3000
3002
}
3001
3003
}
3002
3004
3005
+ #[ test]
3006
+ fn test_example_confs ( ) {
3007
+ // For each config file in the ../conf/ directory, we should be able to parse it
3008
+ let conf_dir = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "conf" ) ;
3009
+ println ! ( "Reading config files from: {:?}" , conf_dir) ;
3010
+ let conf_files = fs:: read_dir ( conf_dir) . unwrap ( ) ;
3011
+
3012
+ for entry in conf_files {
3013
+ let entry = entry. unwrap ( ) ;
3014
+ let path = entry. path ( ) ;
3015
+ if path. is_file ( ) {
3016
+ let file_name = path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
3017
+ if file_name. ends_with ( ".toml" ) {
3018
+ let _config = ConfigFile :: from_path ( path. to_str ( ) . unwrap ( ) ) . unwrap ( ) ;
3019
+ debug ! ( "Parsed config file: {}" , file_name) ;
3020
+ }
3021
+ }
3022
+ }
3023
+ }
3024
+
3003
3025
#[ test]
3004
3026
fn should_load_legacy_mstx_balances_toml ( ) {
3005
3027
let config = ConfigFile :: from_str (
You can’t perform that action at this time.
0 commit comments