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:658–675  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected