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 — Fix tests broken by the feat/gradle-support merge · SocketDev/socket-patch@4a92588

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • crates/socket-patch-cli
    • src/commands
      • vex_consumed.rs
    • tests
      • e2e_sbt_vendor.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
@@ -729,8 +729,11 @@ mod tests {
729729
None,
730730
)
731731
.await;
732-
assert_eq!(installed_again, installed);
733-
let (paths, calls) = tracked_npm_hosted(&common, &installed_again).await;
732+
// Since #605 the name-keyed resolver probes bundled trees itself, so
733+
// it already returns the aliases and the nested store's peers. Feed
734+
// the earlier, alias-free set to keep exercising alias expansion;
735+
// the resolver's own set is checked against the same result below.
736+
let (paths, calls) = tracked_npm_hosted(&common, &installed).await;
734737
assert_eq!(calls.len(), 1);
735738
let mut inputs = calls[0].clone();
736739
inputs.sort();
@@ -752,6 +755,9 @@ mod tests {
752755
.len(),
753756
paths.len()
754757
);
758+
let (mut resolved, _) = tracked_npm_hosted(&common, &installed_again).await;
759+
resolved.sort();
760+
assert_eq!(resolved, expected, "the resolver's own copy set");
755761
}
756762

757763
#[cfg(unix)]
@@ -782,14 +788,19 @@ mod tests {
782788
None,
783789
)
784790
.await;
785-
assert!(installed.is_empty(), "{installed:?}");
786-
let (mut paths, calls) = tracked_npm_hosted(&common, &installed).await;
791+
// Since #605 the name-keyed resolver reaches the alias and its
792+
// sibling peers on its own. An alias-only set (what an alias-blind
793+
// resolver returns) must still expand to the same copies.
794+
let (mut paths, calls) = tracked_npm_hosted(&common, &HashMap::new()).await;
787795
assert_eq!(calls, vec![vec![alias.clone()]]);
788796
let mut expected = peers;
789797
expected.push(alias);
790798
paths.sort();
791799
expected.sort();
792800
assert_eq!(paths, expected);
801+
let (mut resolved, _) = tracked_npm_hosted(&common, &installed).await;
802+
resolved.sort();
803+
assert_eq!(resolved, expected, "the resolver's own copy set");
793804
}
794805

795806
#[cfg(unix)]
Collapse file

‎crates/socket-patch-cli/tests/e2e_sbt_vendor.rs‎

Copy file name to clipboardExpand all lines: crates/socket-patch-cli/tests/e2e_sbt_vendor.rs
+22-13Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,9 @@ fn vendor_forged_ledger_touches_nothing() {
609609
}
610610
}
611611

612-
/// The generated file or the tree symlinked out of the checkout is refused
613-
/// with `build_file_outside_root`, and nothing is written through it.
612+
/// The generated file symlinked out of the checkout is refused with
613+
/// `build_file_outside_root` (a linked `.socket/vendor` with the shared
614+
/// `vendor_dir_symlink_unsupported`), and nothing is written through it.
614615
#[cfg(unix)]
615616
#[test]
616617
fn vendor_escaping_symlinks_are_refused() {
@@ -627,17 +628,25 @@ fn vendor_escaping_symlinks_are_refused() {
627628
std::os::unix::fs::symlink(&target, fx.proj().join(link)).unwrap();
628629
let (code, env) = fx.run(&["vendor"]);
629630
assert_ne!(code, Some(0), "{link}: {env}");
630-
assert_eq!(
631-
env["events"][0]["errorCode"], "vendor_jvm_shape_unsupported",
632-
"{link}: {env}"
633-
);
634-
assert!(
635-
env["events"][0]["error"]
636-
.as_str()
637-
.unwrap_or_default()
638-
.starts_with("reason: build_file_outside_root: "),
639-
"{link}: {env}"
640-
);
631+
if link == ".socket/vendor" {
632+
// Every ecosystem refuses a linked vendor dir up front (#664).
633+
assert_eq!(
634+
env["events"][0]["errorCode"], "vendor_dir_symlink_unsupported",
635+
"{link}: {env}"
636+
);
637+
} else {
638+
assert_eq!(
639+
env["events"][0]["errorCode"], "vendor_jvm_shape_unsupported",
640+
"{link}: {env}"
641+
);
642+
assert!(
643+
env["events"][0]["error"]
644+
.as_str()
645+
.unwrap_or_default()
646+
.starts_with("reason: build_file_outside_root: "),
647+
"{link}: {env}"
648+
);
649+
}
641650
assert_eq!(
642651
std::fs::read_dir(&outside).unwrap().count(),
643652
0,

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.