Skip to content

Commit

Permalink
Update snapshot tests (exact hash values changed)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgw committed Feb 4, 2025
1 parent a135e43 commit c4a1fce
Show file tree
Hide file tree
Showing 32 changed files with 308 additions and 302 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ impl Analyzer<'_> {
}
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub(crate) enum Key {
ModuleEvaluation,
Export(RcStr),
Expand Down
10 changes: 8 additions & 2 deletions turbopack/crates/turbopack-ecmascript/src/tree_shake/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt::Write, hash::Hash, path::PathBuf, sync::Arc};
use std::{collections::BTreeMap, fmt::Write, hash::Hash, path::PathBuf, sync::Arc};

use anyhow::Error;
use serde::Deserialize;
Expand Down Expand Up @@ -192,7 +192,13 @@ fn run(input: PathBuf) {
..
} = g.split_module(&[], analyzer.items);

writeln!(s, "# Entrypoints\n\n```\n{:#?}\n```\n\n", entrypoints).unwrap();
writeln!(
s,
"# Entrypoints\n\n```\n{:#?}\n```\n\n",
// sort entrypoints for the snapshot
entrypoints.iter().collect::<BTreeMap<_, _>>(),
)
.unwrap();

if !skip_parts {
writeln!(s, "# Modules ({})", if is_debug { "dev" } else { "prod" }).unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,16 @@ graph TD
Export(
"external1",
): 10,
Exports: 14,
Export(
"external2",
): 11,
Export(
"foo",
): 13,
Export(
"foobar",
): 11,
Export(
"external2",
): 11,
Exports: 14,
}
```

Expand Down Expand Up @@ -612,16 +612,16 @@ import "__TURBOPACK_PART__" assert {
Export(
"external1",
): 9,
Exports: 12,
Export(
"external2",
): 10,
Export(
"foo",
): 3,
Export(
"foobar",
): 11,
Export(
"external2",
): 10,
Exports: 12,
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,16 @@ graph TD
Export(
"external1",
): 0,
Exports: 14,
Export(
"external2",
): 11,
Export(
"foo",
): 13,
Export(
"foobar",
): 11,
Export(
"external2",
): 11,
Exports: 14,
}
```

Expand Down Expand Up @@ -631,16 +631,16 @@ import "__TURBOPACK_PART__" assert {
Export(
"external1",
): 0,
Exports: 12,
Export(
"external2",
): 10,
Export(
"foo",
): 4,
Export(
"foobar",
): 11,
Export(
"external2",
): 10,
Exports: 12,
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ graph TD
{
ModuleEvaluation: 12,
Export(
"serverHooks",
): 11,
"originalPathname",
): 10,
Export(
"patchFetch",
): 11,
Expand All @@ -375,13 +375,13 @@ graph TD
Export(
"routeModule",
): 14,
Exports: 15,
Export(
"workAsyncStorage",
"serverHooks",
): 11,
Export(
"originalPathname",
): 10,
"workAsyncStorage",
): 11,
Exports: 15,
}
```

Expand Down Expand Up @@ -608,25 +608,25 @@ import "__TURBOPACK_PART__" assert {
```
{
ModuleEvaluation: 12,
Export(
"originalPathname",
): 10,
Export(
"patchFetch",
): 11,
Export(
"requestAsyncStorage",
): 13,
Export(
"serverHooks",
): 15,
Export(
"routeModule",
): 14,
Exports: 17,
Export(
"serverHooks",
): 15,
Export(
"workAsyncStorage",
): 16,
Export(
"originalPathname",
): 10,
Exports: 17,
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ graph TD
```
{
ModuleEvaluation: 2,
Exports: 3,
Export(
"b",
): 1,
Export(
"a",
): 0,
Export(
"b",
): 1,
Exports: 3,
}
```

Expand Down Expand Up @@ -143,13 +143,13 @@ export { b } from "__TURBOPACK_PART__" assert {
```
{
ModuleEvaluation: 2,
Exports: 3,
Export(
"b",
): 1,
Export(
"a",
): 0,
Export(
"b",
): 1,
Exports: 3,
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,20 +392,20 @@ graph TD

```
{
Export(
"getChimera",
): 10,
ModuleEvaluation: 11,
Export(
"initialCat",
): 9,
Exports: 13,
Export(
"cat",
): 12,
Export(
"dogRef",
): 3,
Export(
"getChimera",
): 10,
Export(
"initialCat",
): 9,
Exports: 13,
}
```

Expand Down Expand Up @@ -613,19 +613,19 @@ import "__TURBOPACK_PART__" assert {
```
{
ModuleEvaluation: 2,
Export(
"cat",
): 7,
Export(
"dogRef",
): 3,
Export(
"getChimera",
): 6,
Export(
"initialCat",
): 5,
Exports: 8,
Export(
"cat",
): 7,
Export(
"dogRef",
): 3,
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,17 @@ graph TD

```
{
Export(
"connectHMR",
): 2,
ModuleEvaluation: 5,
Export(
"addMessageListener",
): 3,
Exports: 6,
Export(
"connectHMR",
): 2,
Export(
"sendMessage",
): 4,
Exports: 6,
}
```

Expand Down Expand Up @@ -385,17 +385,17 @@ export { sendMessage } from "__TURBOPACK_PART__" assert {

```
{
Export(
"connectHMR",
): 2,
ModuleEvaluation: 5,
Export(
"addMessageListener",
): 3,
Exports: 6,
Export(
"connectHMR",
): 2,
Export(
"sendMessage",
): 4,
Exports: 6,
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,31 +603,31 @@ graph TD

```
{
ModuleEvaluation: 17,
Export(
"Postpone",
): 12,
Export(
"createPostponedAbortSignal",
): 16,
Export(
"createPrerenderState",
): 9,
ModuleEvaluation: 17,
Export(
"formatDynamicAPIAccesses",
): 15,
Export(
"markCurrentScopeAsDynamic",
): 10,
Export(
"usedDynamicAPIs",
): 14,
Export(
"trackDynamicDataAccessed",
): 11,
Export(
"Postpone",
): 12,
Export(
"trackDynamicFetch",
): 13,
Export(
"createPostponedAbortSignal",
): 16,
Export(
"formatDynamicAPIAccesses",
): 15,
"usedDynamicAPIs",
): 14,
Exports: 18,
}
```
Expand Down Expand Up @@ -985,31 +985,31 @@ import "__TURBOPACK_PART__" assert {

```
{
ModuleEvaluation: 19,
Export(
"Postpone",
): 12,
Export(
"createPostponedAbortSignal",
): 18,
Export(
"createPrerenderState",
): 9,
ModuleEvaluation: 19,
Export(
"formatDynamicAPIAccesses",
): 16,
Export(
"markCurrentScopeAsDynamic",
): 10,
Export(
"usedDynamicAPIs",
): 15,
Export(
"trackDynamicDataAccessed",
): 11,
Export(
"Postpone",
): 12,
Export(
"trackDynamicFetch",
): 13,
Export(
"createPostponedAbortSignal",
): 18,
Export(
"formatDynamicAPIAccesses",
): 16,
"usedDynamicAPIs",
): 15,
Exports: 20,
}
```
Expand Down
Loading

0 comments on commit c4a1fce

Please sign in to comment.