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

Function synonyms_deduped

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

Source from the content-addressed store, hash-verified

390
391 #[test]
392 fn synonyms_deduped() {
393 let f = Fixtures::copy("simple");
394 let repo_id = RepoId::wiki();
395 let topic_id = parse_id("00001");
396 let topic = f.git.fetch_topic(repo_id, &topic_id).unwrap();
397
398 assert_eq!(topic.name(Locale::EN), "A topic");
399 assert_eq!(topic.synonyms().len(), 1);
400
401 assert_eq!(count(&f, "A topic"), 1);
402
403 let UpdateTopicSynonymsResult {
404 repo_topic, alerts, ..
405 } = UpdateTopicSynonyms {
406 actor: actor(),
407 repo_id,
408 topic_id,
409 synonyms: vec![synonym("A topic"), synonym("A topic")],
410 }
411 .call(f.mutation(), &redis::Noop)
412 .unwrap();
413
414 assert_eq!(repo_topic.synonyms().len(), 1);
415 assert_eq!(count(&f, "A topic"), 1);
416
417 // There's an alert
418 assert_eq!(alerts.len(), 1);
419 }
420
421 #[test]
422 fn synonyms_removed() {

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