pub fn verify(&self) {
        let graph = self.graph();

        graph.verify().expect("graph verification should succeed");

        // Check that all external sources parse correctly in all graphs.
        for package in graph.packages() {
            let source = package.source();
            if source.is_external() {
                let external = source
                    .parse_external()
                    .unwrap_or_else(|| panic!("cannot parse external source {}", source));
                assert_eq!(
                    format!("{}", external),
                    source.external_source().expect("is_external is true"),
                    "roundtrip with ExternalSource"
                );
            }
        }

        self.details.assert_cycles(graph, "cycles");

        self.details.assert_workspace(graph.workspace());
        self.details.assert_topo(graph);

        for id in self.details.known_ids() {
            let msg = format!("error while verifying package '{}'", id);
            let metadata = graph.metadata(id).expect(&msg);
            self.details.assert_metadata(id, metadata, &msg);

            // Check for build targets.
            if self.details.has_build_targets(id) {
                self.details.assert_build_targets(metadata, &msg);
            }

            // Check for direct dependency queries.
            if self.details.has_deps(id) {
                self.details.assert_deps(graph, id, &msg);
            }
            if self.details.has_reverse_deps(id) {
                self.details.assert_reverse_deps(graph, id, &msg);
            }

            // Check for transitive dependency queries. Use both ID based and edge-based queries.
            if self.details.has_transitive_deps(id) {
                self.details.assert_transitive_deps(
                    graph,
                    id,
                    &format!("{} (transitive deps)", msg),
                );
            }
            if self.details.has_transitive_reverse_deps(id) {
                self.details.assert_transitive_reverse_deps(
                    graph,
                    id,
                    &format!("{} (transitive reverse deps)", msg),
                );
            }

            // Check for named features.
            if self.details.has_named_features(id) {
                self.details
                    .assert_named_features(graph, id, &format!("{} (named features)", msg));
            }
        }

        self.details.assert_link_details(graph, "link details");

        // Tests for the feature graph.
        self.details
            .assert_feature_graph_warnings(graph, "feature graph warnings");
    }
Verifies that the parsed metadata matches known details.
fixtures/src/json.rs