trpl-zh-cn/listings/ch18-oop/listing-18-13/src/main.rs
2024-10-20 23:44:05 +08:00

15 lines
302 B
Rust

use blog::Post;
fn main() {
let mut post = Post::new();
post.add_text("I ate a salad for lunch today");
assert_eq!("", post.content());
post.request_review();
assert_eq!("", post.content());
post.approve();
assert_eq!("I ate a salad for lunch today", post.content());
}