GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Port #851: fix vex alias tests broken by the store-copy merge · SocketDev/socket-patch@9334fe9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • crates/socket-patch-cli/src/commands
    • vex_consumed.rs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎crates/socket-patch-cli/src/commands/vex_consumed.rs‎

Copy file name to clipboardExpand all lines: crates/socket-patch-cli/src/commands/vex_consumed.rs
+15-4Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,11 @@ mod tests {
715715
None,
716716
)
717717
.await;
718-
assert_eq!(installed_again, installed);
719-
let (paths, calls) = tracked_npm_hosted(&common, &installed_again).await;
718+
// Since #605 the name-keyed resolver probes bundled trees itself, so
719+
// it already returns the aliases and the nested store's peers. Feed
720+
// the earlier, alias-free set to keep exercising alias expansion;
721+
// the resolver's own set is checked against the same result below.
722+
let (paths, calls) = tracked_npm_hosted(&common, &installed).await;
720723
assert_eq!(calls.len(), 1);
721724
let mut inputs = calls[0].clone();
722725
inputs.sort();
@@ -738,6 +741,9 @@ mod tests {
738741
.len(),
739742
paths.len()
740743
);
744+
let (mut resolved, _) = tracked_npm_hosted(&common, &installed_again).await;
745+
resolved.sort();
746+
assert_eq!(resolved, expected, "the resolver's own copy set");
741747
}
742748

743749
#[cfg(unix)]
@@ -768,14 +774,19 @@ mod tests {
768774
None,
769775
)
770776
.await;
771-
assert!(installed.is_empty(), "{installed:?}");
772-
let (mut paths, calls) = tracked_npm_hosted(&common, &installed).await;
777+
// Since #605 the name-keyed resolver reaches the alias and its
778+
// sibling peers on its own. An alias-only set (what an alias-blind
779+
// resolver returns) must still expand to the same copies.
780+
let (mut paths, calls) = tracked_npm_hosted(&common, &HashMap::new()).await;
773781
assert_eq!(calls, vec![vec![alias.clone()]]);
774782
let mut expected = peers;
775783
expected.push(alias);
776784
paths.sort();
777785
expected.sort();
778786
assert_eq!(paths, expected);
787+
let (mut resolved, _) = tracked_npm_hosted(&common, &installed).await;
788+
resolved.sort();
789+
assert_eq!(resolved, expected, "the resolver's own copy set");
779790
}
780791

781792
#[cfg(unix)]

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.