()
| 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() { |
nothing calls this directly
no test coverage detected