Skip to content

Commit

Permalink
test: update test desc
Browse files Browse the repository at this point in the history
  • Loading branch information
xusd320 committed Sep 3, 2024
1 parent 2021371 commit a2ad316
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 6 additions & 2 deletions crates/mako/src/generate/chunk_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,15 @@ impl ChunkGraph {

pub fn sync_dependencies_chunk(&self, chunk_id: &ChunkId) -> Vec<ChunkId> {
let idx = self.id_index_map.get(chunk_id).unwrap();
self.graph
let ret = self
.graph
.neighbors_directed(*idx, Direction::Outgoing)
.filter(|idx| matches!(self.graph[*idx].chunk_type, ChunkType::Sync))
.map(|idx| self.graph[idx].id.clone())
.collect::<Vec<ChunkId>>()
.collect::<Vec<ChunkId>>();
// The neighbors ordering is reversed, see https://github.com/petgraph/petgraph/issues/116,
// so need to add edges by reversed order
ret.into_iter().rev().collect()
}

pub fn entry_dependencies_chunk(&self, chunk_id: &ChunkId) -> Vec<ChunkId> {
Expand Down
6 changes: 1 addition & 5 deletions crates/mako/src/generate/optimize_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,7 @@ impl Compiler {
// add edge to original chunks
edges_map
.iter()
.flat_map(|(from, tos)| {
// The neighbors ordering is reversed, see https://github.com/petgraph/petgraph/issues/116,
// so need to add edges by reversed order
tos.iter().rev().map(move |to| (from, to))
})
.flat_map(|(from, tos)| tos.iter().map(move |to| (from, to)))
.for_each(|(from, to)| {
chunk_graph.add_edge(from, to);
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/fixtures/css.css-merge-deep-level/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ assert(
color: red;
}
`.trim()),
"css merge in js should work"
"css merge deep level should work"
);
2 changes: 1 addition & 1 deletion e2e/fixtures/css.css-merge-in-css-multi-imports/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ assert(
color: blue;
}
`.trim()),
"css merge in css should work"
"css merge in css multi imports should work"
);
2 changes: 1 addition & 1 deletion e2e/fixtures/css.css-merge-reverse-by-descent/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ assert(
.d {
color: black;
}`.trim()),
"css merge in js should work"
"css merge reverse by descent should work"
);

0 comments on commit a2ad316

Please sign in to comment.