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 @@ -824,6 +824,28 @@ chain_id = {chain_id}
824824mod tests {
825825 use super :: * ;
826826
827+ #[ test]
828+ fn test_example_confs ( ) {
829+ // Validate that all sample signer config files in sample/conf/signer/ parse as valid TOML.
830+ // Uses RawConfigFile (not GlobalConfig) since reference configs have placeholder values.
831+ let conf_dir = PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "../sample/conf/signer" ) ;
832+ println ! ( "Reading signer config files from: {conf_dir:?}" ) ;
833+ let conf_files = fs:: read_dir ( & conf_dir) . unwrap ( ) ;
834+
835+ for entry in conf_files {
836+ let entry = entry. unwrap ( ) ;
837+ let path = entry. path ( ) ;
838+ if path. is_file ( ) {
839+ let file_name = path. file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) ;
840+ if file_name. ends_with ( ".toml" ) {
841+ let data = fs:: read_to_string ( & path) . unwrap ( ) ;
842+ RawConfigFile :: load_from_str ( & data)
843+ . unwrap_or_else ( |e| panic ! ( "Failed to parse {file_name}: {e}" ) ) ;
844+ }
845+ }
846+ }
847+ }
848+
827849 #[ test]
828850 fn build_signer_config_tomls_should_produce_deserializable_strings ( ) {
829851 let pk = StacksPrivateKey :: from_hex (
You can’t perform that action at this time.
0 commit comments