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

Function whitespace_removed

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

Source from the content-addressed store, hash-verified

542
543 #[test]
544 fn whitespace_removed() {
545 let f = Fixtures::copy("simple");
546 let repo_id = RepoId::wiki();
547 let topic_id = parse_id("00001");
548
549 let UpdateTopicSynonymsResult { repo_topic, .. } = UpdateTopicSynonyms {
550 actor: actor(),
551 repo_id,
552 topic_id,
553 synonyms: vec![
554 synonym("A topic"),
555 synonym(" Second synonym "),
556 synonym("\tSynonym with\ttabs\t"),
557 ],
558 }
559 .call(f.mutation(), &redis::Noop)
560 .unwrap();
561
562 let synonyms = repo_topic.synonyms();
563 assert_eq!(synonyms.len(), 3);
564
565 assert_eq!(synonyms[0].name, "A topic");
566 assert_eq!(synonyms[1].name, "Second synonym");
567 assert_eq!(synonyms[2].name, "Synonym with tabs");
568 }
569
570 #[test]
571 fn empty_synonyms_dropped() {

Callers

nothing calls this directly

Calls 6

parse_idFunction · 0.85
actorFunction · 0.85
assert_topic_addedFunction · 0.85
callMethod · 0.45
mutationMethod · 0.45
synonymsMethod · 0.45

Tested by

no test coverage detected