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

Function synonyms_added

backend/tests/git/topic.rs:362–389  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

360
361 #[test]
362 fn synonyms_added() {
363 let f = Fixtures::copy("simple");
364 let repo_id = RepoId::wiki();
365 let topic_id = parse_id("00001");
366 let topic = f.git.fetch_topic(repo_id, &topic_id).unwrap();
367
368 assert_eq!(topic.name(Locale::EN), "A topic");
369 assert_eq!(topic.synonyms().len(), 1);
370
371 assert_eq!(count(&f, "A topic"), 1);
372 assert_eq!(count(&f, "B topic"), 0);
373 assert_eq!(count(&f, "C topic"), 0);
374
375 let UpdateTopicSynonymsResult { repo_topic, .. } = UpdateTopicSynonyms {
376 actor: actor(),
377 repo_id,
378 topic_id,
379 synonyms: vec![synonym("A topic"), synonym("B topic"), synonym("C topic")],
380 }
381 .call(f.mutation(), &redis::Noop)
382 .unwrap();
383
384 assert_eq!(repo_topic.synonyms().len(), 3);
385
386 assert_eq!(count(&f, "A topic"), 1);
387 assert_eq!(count(&f, "B topic"), 1);
388 assert_eq!(count(&f, "C topic"), 1);
389 }
390
391 #[test]
392 fn synonyms_deduped() {

Callers

nothing calls this directly

Calls 5

parse_idFunction · 0.85
actorFunction · 0.85
fetch_topicMethod · 0.45
callMethod · 0.45
mutationMethod · 0.45

Tested by

no test coverage detected