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

Function parent_topic_updated

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

Source from the content-addressed store, hash-verified

779
780 #[test]
781 fn parent_topic_updated() {
782 let f = Fixtures::copy("simple");
783 let repo_id = RepoId::wiki();
784 let path = parse_id("00001");
785 let parent = f.topic(repo_id, "00001");
786 assert_eq!(parent.children, BTreeSet::new());
787
788 let result = f
789 .upsert_topic(repo_id, "Topic name", &path, OnMatchingSynonym::Ask)
790 .unwrap();
791 assert!(result.saved);
792 let child = result.repo_topic.unwrap();
793 let child_id = &child.topic_id();
794
795 let parent = f.topic(repo_id, "00001");
796 let children = parent
797 .children
798 .iter()
799 .map(|child| child.id.to_string())
800 .collect::<Vec<String>>();
801
802 assert_eq!(children, vec![child_id.to_string()]);
803 }
804
805 #[test]
806 fn no_cycles() {

Callers

nothing calls this directly

Calls 5

parse_idFunction · 0.85
topicMethod · 0.45
upsert_topicMethod · 0.45
topic_idMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected