MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / detect_source_manifest_happy_path

Function detect_source_manifest_happy_path

atomic-cli/src/commands/update.rs:657–674  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

655
656 #[test]
657 fn detect_source_manifest_happy_path() {
658 let state = TempDir::new().unwrap();
659 let bin_dir = TempDir::new().unwrap();
660 let bin = bin_dir.path().join("atomic");
661 fs::write(&bin, b"#!/bin/sh\n").unwrap();
662
663 write_manifest(state.path(), &bin, "0.6.0", 1);
664
665 let env = MockEnv::new().set("XDG_STATE_HOME", state.path().to_str().unwrap());
666 match detect_source(&bin, &env) {
667 InstallSource::OfficialInstaller {
668 recorded_version, ..
669 } => {
670 assert_eq!(recorded_version, "0.6.0");
671 }
672 other => panic!("expected OfficialInstaller, got {other:?}"),
673 }
674 }
675
676 #[test]
677 fn detect_source_manifest_path_mismatch_falls_through() {

Callers

nothing calls this directly

Calls 6

writeFunction · 0.85
write_manifestFunction · 0.85
detect_sourceFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected