@@ -11,7 +11,7 @@ use serde_json::{json, to_string_pretty};
1111use shared:: test_utils:: output_assert:: {
1212 AsOutput , assert_stderr_contains, assert_stdout, assert_stdout_contains,
1313} ;
14- use snapbox:: assert_matches ;
14+ use snapbox:: assert_data_eq ;
1515use sncast:: AccountType ;
1616use sncast:: helpers:: constants:: {
1717 BRAAVOS_BASE_ACCOUNT_CLASS_HASH , BRAAVOS_CLASS_HASH , OZ_CLASS_HASH , READY_CLASS_HASH ,
@@ -85,7 +85,7 @@ pub async fn test_happy_case(account_type: &str) {
8585 }
8686 ) ;
8787
88- assert_matches ( to_string_pretty ( & expected) . unwrap ( ) , contents ) ;
88+ assert_data_eq ! ( contents , to_string_pretty( & expected) . unwrap( ) ) ;
8989}
9090
9191// TODO(#3556): Remove this test once we drop Argent account type
@@ -153,7 +153,7 @@ pub async fn test_happy_case_argent_with_deprecation_warning() {
153153 }
154154 ) ;
155155
156- assert_matches ( to_string_pretty ( & expected) . unwrap ( ) , contents ) ;
156+ assert_data_eq ! ( contents , to_string_pretty( & expected) . unwrap( ) ) ;
157157}
158158
159159#[ tokio:: test]
@@ -214,7 +214,7 @@ pub async fn test_happy_case_generate_salt() {
214214 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
215215 . current_dir ( temp_dir. path ( ) ) ;
216216
217- snapbox. assert ( ) . success ( ) . stdout_matches ( indoc ! { r"
217+ snapbox. assert ( ) . success ( ) . stdout_eq ( indoc ! { r"
218218 Success: Account created
219219
220220 Address: 0x0[..]
@@ -302,7 +302,7 @@ pub async fn test_happy_case_accounts_file_already_exists() {
302302 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
303303 . current_dir ( temp_dir. path ( ) ) ;
304304
305- snapbox. assert ( ) . success ( ) . stdout_matches ( indoc ! { r"
305+ snapbox. assert ( ) . success ( ) . stdout_eq ( indoc ! { r"
306306 Success: Account created
307307
308308 Address: 0x0[..]
@@ -436,7 +436,7 @@ pub async fn test_happy_case_keystore(account_type: &str) {
436436 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
437437 . current_dir ( temp_dir. path ( ) ) ;
438438
439- snapbox. assert ( ) . stdout_matches ( formatdoc ! { r"
439+ snapbox. assert ( ) . stdout_eq ( formatdoc ! { r"
440440 Success: Account created
441441
442442 Address: 0x0[..]
@@ -455,9 +455,9 @@ pub async fn test_happy_case_keystore(account_type: &str) {
455455 let contents = fs:: read_to_string ( temp_dir. path ( ) . join ( account_file) )
456456 . expect ( "Unable to read created file" ) ;
457457
458- assert_matches (
459- get_keystore_account_pattern ( account_type. parse ( ) . unwrap ( ) , None ) ,
458+ assert_data_eq ! (
460459 contents,
460+ get_keystore_account_pattern( account_type. parse( ) . unwrap( ) , None ) ,
461461 ) ;
462462}
463463
@@ -486,7 +486,7 @@ pub async fn test_happy_case_keystore_argent_with_deprecation_warning() {
486486 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
487487 . current_dir ( temp_dir. path ( ) ) ;
488488
489- snapbox. assert ( ) . stdout_matches ( formatdoc ! { r"
489+ snapbox. assert ( ) . stdout_eq ( formatdoc ! { r"
490490 [WARNING] Argent has rebranded as Ready. The `argent` option for the `--type` flag in `account create` is deprecated, please use `ready` instead.
491491
492492 Success: Account created
@@ -507,9 +507,9 @@ pub async fn test_happy_case_keystore_argent_with_deprecation_warning() {
507507 let contents = fs:: read_to_string ( temp_dir. path ( ) . join ( account_file) )
508508 . expect ( "Unable to read created file" ) ;
509509
510- assert_matches (
511- get_keystore_account_pattern ( "argent" . parse ( ) . unwrap ( ) , None ) ,
510+ assert_data_eq ! (
512511 contents,
512+ get_keystore_account_pattern( "argent" . parse( ) . unwrap( ) , None ) ,
513513 ) ;
514514}
515515
@@ -692,7 +692,7 @@ pub async fn test_happy_case_keystore_int_format() {
692692 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
693693 . current_dir ( temp_dir. path ( ) ) ;
694694
695- snapbox. assert ( ) . stdout_matches ( formatdoc ! { r"
695+ snapbox. assert ( ) . stdout_eq ( formatdoc ! { r"
696696 Success: Account created
697697
698698 Address: [..]
@@ -747,7 +747,7 @@ pub async fn test_happy_case_default_name_generation() {
747747 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
748748 . current_dir ( tempdir. path ( ) )
749749 . assert ( )
750- . stdout_matches ( formatdoc ! { r"
750+ . stdout_eq ( formatdoc ! { r"
751751 Success: Account created
752752
753753 Address: 0x0[..]
@@ -780,7 +780,7 @@ pub async fn test_happy_case_default_name_generation() {
780780 . stdin ( "Y" )
781781 . assert ( )
782782 . success ( )
783- . stdout_matches ( indoc ! { r"
783+ . stdout_eq ( indoc ! { r"
784784 Success: Account deleted
785785
786786 Account successfully removed
@@ -835,7 +835,7 @@ pub async fn test_happy_case_default_name_generation() {
835835 }
836836 ) ;
837837
838- assert_matches ( to_string_pretty ( & expected) . unwrap ( ) , contents ) ;
838+ assert_data_eq ! ( contents , to_string_pretty( & expected) . unwrap( ) ) ;
839839}
840840
841841fn get_formatted_account_type ( account_type : & str ) -> & str {
@@ -1011,7 +1011,7 @@ pub async fn test_json_output_format() {
10111011 let snapbox = runner ( & args)
10121012 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
10131013 . current_dir ( temp_dir. path ( ) ) ;
1014- snapbox. assert ( ) . stdout_matches ( indoc ! { r#"
1014+ snapbox. assert ( ) . stdout_eq ( indoc ! { r#"
10151015 {"add_profile":"Profile my_account successfully added to [..]/snfoundry.toml","address":"0x[..]","command":"account create","estimated_fee":"[..]","message":"Account successfully created but it needs to be deployed. The estimated deployment fee is [..] STRK. Prefund the account to cover deployment transaction fee/n/nAfter prefunding the account, run:/nsncast --accounts-file accounts.json account deploy --url [..] --name my_account","type":"response"}
10161016 {"links":"account: https://sepolia.starkscan.co/contract/0x[..]","title":"account creation","type":"notification"}
10171017 "# } ) ;
0 commit comments