doc_test.rs 596 B

12345678910111213141516171819202122
  1. use crate::helper::*;
  2. #[test]
  3. fn file_create_test() {
  4. let doc_desc = create_doc("hello world", "flutter ❤️ rust", "123");
  5. dbg!(&doc_desc);
  6. let doc = read_doc_data(&doc_desc.id, &doc_desc.path);
  7. assert_eq!(doc.text, "123".to_owned());
  8. }
  9. #[test]
  10. fn file_update_text_test() {
  11. let doc_desc = create_doc("hello world", "flutter ❤️ rust", "");
  12. dbg!(&doc_desc);
  13. let content = "😁😁😁😁😁😁😁😁😁😁".to_owned();
  14. save_doc(&doc_desc, &content);
  15. let doc = read_doc_data(&doc_desc.id, &doc_desc.path);
  16. assert_eq!(doc.text, content);
  17. }