()
| 1391 | |
| 1392 | #[test] |
| 1393 | fn paths() { |
| 1394 | let topic1 = topic("Climate change"); |
| 1395 | let topic2 = topic("Climate"); |
| 1396 | let topic3 = topic("Weather"); |
| 1397 | |
| 1398 | let change = Change::UpdateTopicParentTopics(UpdateTopicParentTopics { |
| 1399 | actor_id: "2".to_owned(), |
| 1400 | added_parent_topics: TopicInfoList::from(&topic2), |
| 1401 | date: chrono::Utc::now(), |
| 1402 | id: Change::new_id(), |
| 1403 | parent_topic_ids: BTreeSet::from([topic3.topic_id().to_owned()]), |
| 1404 | removed_parent_topics: TopicInfoList::new(), |
| 1405 | updated_topic: TopicInfo::from(&topic1), |
| 1406 | }); |
| 1407 | |
| 1408 | assert_eq!( |
| 1409 | change.ids(), |
| 1410 | HashSet::from([topic1.topic_id(), topic2.topic_id(), topic3.topic_id()]) |
| 1411 | ); |
| 1412 | } |
| 1413 | } |
| 1414 | |
| 1415 | mod update_topic_synonyms { |
nothing calls this directly
no test coverage detected