MCPcopy Create free account
hub / github.com/emwalker/digraph / link_added

Function link_added

backend/tests/git/link.rs:119–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 5

valid_urlFunction · 0.85
parse_idFunction · 0.85
parseFunction · 0.85
idMethod · 0.45
upsert_linkMethod · 0.45

Tested by

no test coverage detected