@@ -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: [..]
@@ -746,7 +746,7 @@ pub async fn test_happy_case_default_name_generation() {
746746 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
747747 . current_dir ( tempdir. path ( ) )
748748 . assert ( )
749- . stdout_matches ( formatdoc ! { r"
749+ . stdout_eq ( formatdoc ! { r"
750750 Success: Account created
751751
752752 Address: 0x0[..]
@@ -779,7 +779,7 @@ pub async fn test_happy_case_default_name_generation() {
779779 . stdin ( "Y" )
780780 . assert ( )
781781 . success ( )
782- . stdout_matches ( indoc ! { r"
782+ . stdout_eq ( indoc ! { r"
783783 Success: Account deleted
784784
785785 Account successfully removed
@@ -834,7 +834,7 @@ pub async fn test_happy_case_default_name_generation() {
834834 }
835835 ) ;
836836
837- assert_matches ( to_string_pretty ( & expected) . unwrap ( ) , contents ) ;
837+ assert_data_eq ! ( contents , to_string_pretty( & expected) . unwrap( ) ) ;
838838}
839839
840840fn get_formatted_account_type ( account_type : & str ) -> & str {
@@ -1010,7 +1010,7 @@ pub async fn test_json_output_format() {
10101010 let snapbox = runner ( & args)
10111011 . env ( "SNCAST_FORCE_SHOW_EXPLORER_LINKS" , "1" )
10121012 . current_dir ( temp_dir. path ( ) ) ;
1013- snapbox. assert ( ) . stdout_matches ( indoc ! { r#"
1013+ snapbox. assert ( ) . stdout_eq ( indoc ! { r#"
10141014 {"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"}
10151015 {"links":"account: https://sepolia.starkscan.co/contract/0x[..]","title":"account creation","type":"notification"}
10161016 "# } ) ;
0 commit comments