X-Git-Url: https://piware.de/gitweb/?p=learn-rust.git;a=blobdiff_plain;f=concepts%2Fsrc%2Fmain.rs;h=20826216bbd4c0ec5a0e8e3cec408f507b28140b;hp=f9eafe95978b7bb802c7f1b8ffd3088cf2c19792;hb=1962a5412d16f34c738e9f81bb5271da043a7505;hpb=c182c6166ae3971320daaeadba3ea718124303e7 diff --git a/concepts/src/main.rs b/concepts/src/main.rs index f9eafe9..2082621 100644 --- a/concepts/src/main.rs +++ b/concepts/src/main.rs @@ -256,7 +256,19 @@ fn test_dyn_traits() { post.request_review(); assert_eq!("", post.content()); - post.approve(); + post.reject(); + assert_eq!("", post.content()); + + post.request_review(); + assert_eq!("", post.content()); + + post.approve(); // first + assert_eq!("", post.content()); + + post.approve(); // second + assert_eq!(text, post.content()); + + post.reject(); // no-op assert_eq!(text, post.content()); }