()
| 117 | |
| 118 | #[test] |
| 119 | fn link_added() { |
| 120 | let f = Fixtures::copy("simple"); |
| 121 | let url = valid_url(); |
| 122 | let repo_id = RepoId::wiki(); |
| 123 | let link_id = url.id().unwrap(); |
| 124 | let parent_topic = parse_id("00001"); |
| 125 | let search = Search::parse("page title https://www.google.com/").unwrap(); |
| 126 | let entry = SearchEntry { |
| 127 | id: link_id.to_owned(), |
| 128 | kind: Kind::Link, |
| 129 | }; |
| 130 | |
| 131 | assert!(!f.git.exists(repo_id, &link_id).unwrap()); |
| 132 | assert!(!f.git.appears_in(repo_id, &search, &entry).unwrap()); |
| 133 | |
| 134 | f.upsert_link( |
| 135 | repo_id, |
| 136 | &url, |
| 137 | Some("Page title".to_owned()), |
| 138 | Some(parent_topic), |
| 139 | ); |
| 140 | |
| 141 | assert!(f.git.exists(repo_id, &link_id).unwrap()); |
| 142 | assert!(f.git.appears_in(repo_id, &search, &entry).unwrap()); |
| 143 | } |
| 144 | |
| 145 | #[test] |
| 146 | fn whitespace_removed() { |
nothing calls this directly
no test coverage detected