@@ -594,6 +594,8 @@ impl OutputAssert {
594594 /// - `...` is a line-wildcard when on a line by itself
595595 /// - `[..]` is a character-wildcard when inside a line
596596 /// - `[EXE]` matches `.exe` on Windows
597+ /// - `"{...}"` is a JSON value wildcard
598+ /// - `"...": "{...}"` is a JSON key-value wildcard
597599 /// - `\` to `/`
598600 /// - Newlines
599601 ///
@@ -609,7 +611,7 @@ impl OutputAssert {
609611 /// .env("stdout", "hello")
610612 /// .env("stderr", "world")
611613 /// .assert()
612- /// .stdout_eq_ ("he[..]o");
614+ /// .stdout_eq ("he[..]o");
613615 /// ```
614616 ///
615617 /// Can combine this with [`file!`][crate::file]
@@ -622,82 +624,18 @@ impl OutputAssert {
622624 /// .env("stdout", "hello")
623625 /// .env("stderr", "world")
624626 /// .assert()
625- /// .stdout_eq_ (file!["stdout.log"]);
627+ /// .stdout_eq (file!["stdout.log"]);
626628 /// ```
627629 #[ track_caller]
628- pub fn stdout_eq_ ( self , expected : impl IntoData ) -> Self {
630+ pub fn stdout_eq ( self , expected : impl IntoData ) -> Self {
629631 let expected = expected. into_data ( ) ;
630632 self . stdout_eq_inner ( expected)
631633 }
632634
633- /// Ensure the command wrote the expected data to `stdout`.
634- ///
635- /// ```rust,no_run
636- /// use snapbox::cmd::Command;
637- /// use snapbox::cmd::cargo_bin;
638- ///
639- /// let assert = Command::new(cargo_bin("snap-fixture"))
640- /// .env("stdout", "hello")
641- /// .env("stderr", "world")
642- /// .assert()
643- /// .stdout_eq("hello");
644- /// ```
645- ///
646- /// Can combine this with [`file!`][crate::file]
647- /// ```rust,no_run
648- /// use snapbox::cmd::Command;
649- /// use snapbox::cmd::cargo_bin;
650- /// use snapbox::file;
651- ///
652- /// let assert = Command::new(cargo_bin("snap-fixture"))
653- /// .env("stdout", "hello")
654- /// .env("stderr", "world")
655- /// .assert()
656- /// .stdout_eq(file!["stdout.log"]);
657- /// ```
658- #[ track_caller]
659- #[ deprecated(
660- since = "0.5.11" ,
661- note = "Replaced with `OutputAssert::stdout_eq_(expected.raw())`"
662- ) ]
663- pub fn stdout_eq ( self , expected : impl Into < crate :: Data > ) -> Self {
664- let expected = expected. into ( ) ;
665- self . stdout_eq_inner ( expected. raw ( ) )
666- }
667-
668- /// Ensure the command wrote the expected data to `stdout`.
669- ///
670- /// ```rust,no_run
671- /// use snapbox::cmd::Command;
672- /// use snapbox::cmd::cargo_bin;
673- ///
674- /// let assert = Command::new(cargo_bin("snap-fixture"))
675- /// .env("stdout", "hello")
676- /// .env("stderr", "world")
677- /// .assert()
678- /// .stdout_matches("he[..]o");
679- /// ```
680- ///
681- /// Can combine this with [`file!`][crate::file]
682- /// ```rust,no_run
683- /// use snapbox::cmd::Command;
684- /// use snapbox::cmd::cargo_bin;
685- /// use snapbox::file;
686- ///
687- /// let assert = Command::new(cargo_bin("snap-fixture"))
688- /// .env("stdout", "hello")
689- /// .env("stderr", "world")
690- /// .assert()
691- /// .stdout_matches(file!["stdout.log"]);
692- /// ```
693635 #[ track_caller]
694- #[ deprecated(
695- since = "0.5.11" ,
696- note = "Replaced with `OutputAssert::stdout_eq_(expected)`"
697- ) ]
698- pub fn stdout_matches ( self , expected : impl Into < crate :: Data > ) -> Self {
699- let expected = expected. into ( ) ;
700- self . stdout_eq_inner ( expected)
636+ #[ deprecated( since = "0.6.0" , note = "Replaced with `OutputAssert::stdout_eq`" ) ]
637+ pub fn stdout_eq_ ( self , expected : impl IntoData ) -> Self {
638+ self . stdout_eq ( expected)
701639 }
702640
703641 #[ track_caller]
@@ -716,6 +654,8 @@ impl OutputAssert {
716654 /// - `...` is a line-wildcard when on a line by itself
717655 /// - `[..]` is a character-wildcard when inside a line
718656 /// - `[EXE]` matches `.exe` on Windows
657+ /// - `"{...}"` is a JSON value wildcard
658+ /// - `"...": "{...}"` is a JSON key-value wildcard
719659 /// - `\` to `/`
720660 /// - Newlines
721661 ///
@@ -731,7 +671,7 @@ impl OutputAssert {
731671 /// .env("stdout", "hello")
732672 /// .env("stderr", "world")
733673 /// .assert()
734- /// .stderr_eq_ ("wo[..]d");
674+ /// .stderr_eq ("wo[..]d");
735675 /// ```
736676 ///
737677 /// Can combine this with [`file!`][crate::file]
@@ -744,82 +684,18 @@ impl OutputAssert {
744684 /// .env("stdout", "hello")
745685 /// .env("stderr", "world")
746686 /// .assert()
747- /// .stderr_eq_ (file!["stderr.log"]);
687+ /// .stderr_eq (file!["stderr.log"]);
748688 /// ```
749689 #[ track_caller]
750- pub fn stderr_eq_ ( self , expected : impl IntoData ) -> Self {
690+ pub fn stderr_eq ( self , expected : impl IntoData ) -> Self {
751691 let expected = expected. into_data ( ) ;
752692 self . stderr_eq_inner ( expected)
753693 }
754694
755- /// Ensure the command wrote the expected data to `stderr`.
756- ///
757- /// ```rust,no_run
758- /// use snapbox::cmd::Command;
759- /// use snapbox::cmd::cargo_bin;
760- ///
761- /// let assert = Command::new(cargo_bin("snap-fixture"))
762- /// .env("stdout", "hello")
763- /// .env("stderr", "world")
764- /// .assert()
765- /// .stderr_eq("world");
766- /// ```
767- ///
768- /// Can combine this with [`file!`][crate::file]
769- /// ```rust,no_run
770- /// use snapbox::cmd::Command;
771- /// use snapbox::cmd::cargo_bin;
772- /// use snapbox::file;
773- ///
774- /// let assert = Command::new(cargo_bin("snap-fixture"))
775- /// .env("stdout", "hello")
776- /// .env("stderr", "world")
777- /// .assert()
778- /// .stderr_eq(file!["stderr.log"]);
779- /// ```
780- #[ track_caller]
781- #[ deprecated(
782- since = "0.5.11" ,
783- note = "Replaced with `OutputAssert::stderr_eq_(expected.raw())`"
784- ) ]
785- pub fn stderr_eq ( self , expected : impl Into < crate :: Data > ) -> Self {
786- let expected = expected. into ( ) ;
787- self . stderr_eq_inner ( expected. raw ( ) )
788- }
789-
790- /// Ensure the command wrote the expected data to `stderr`.
791- ///
792- /// ```rust,no_run
793- /// use snapbox::cmd::Command;
794- /// use snapbox::cmd::cargo_bin;
795- ///
796- /// let assert = Command::new(cargo_bin("snap-fixture"))
797- /// .env("stdout", "hello")
798- /// .env("stderr", "world")
799- /// .assert()
800- /// .stderr_matches("wo[..]d");
801- /// ```
802- ///
803- /// Can combine this with [`file!`][crate::file]
804- /// ```rust,no_run
805- /// use snapbox::cmd::Command;
806- /// use snapbox::cmd::cargo_bin;
807- /// use snapbox::file;
808- ///
809- /// let assert = Command::new(cargo_bin("snap-fixture"))
810- /// .env("stdout", "hello")
811- /// .env("stderr", "world")
812- /// .assert()
813- /// .stderr_matches(file!["stderr.log"]);
814- /// ```
815695 #[ track_caller]
816- #[ deprecated(
817- since = "0.5.11" ,
818- note = "Replaced with `OutputAssert::stderr_eq_(expected)`"
819- ) ]
820- pub fn stderr_matches ( self , expected : impl Into < crate :: Data > ) -> Self {
821- let expected = expected. into ( ) ;
822- self . stderr_eq_inner ( expected)
696+ #[ deprecated( since = "0.6.0" , note = "Replaced with `OutputAssert::stderr_eq`" ) ]
697+ pub fn stderr_eq_ ( self , expected : impl IntoData ) -> Self {
698+ self . stderr_eq ( expected)
823699 }
824700
825701 #[ track_caller]
0 commit comments