]> piware.de Git - learn-rust.git/blobdiff - concepts/src/main.rs
concepts: require two Post approvals
[learn-rust.git] / concepts / src / main.rs
index 3e9bbbd0cd042234615d20dd563baf6278258464..20826216bbd4c0ec5a0e8e3cec408f507b28140b 100644 (file)
@@ -262,7 +262,13 @@ fn test_dyn_traits() {
     post.request_review();
     assert_eq!("", post.content());
 
-    post.approve();
+    post.approve();  // first
+    assert_eq!("", post.content());
+
+    post.approve();  // second
+    assert_eq!(text, post.content());
+
+    post.reject();  // no-op
     assert_eq!(text, post.content());
 }