(path: impl AsRef<Path>, content: &str)
| 805 | } |
| 806 | |
| 807 | fn write_test_executable(path: impl AsRef<Path>, content: &str) { |
| 808 | let path = path.as_ref(); |
| 809 | fs::write(path, content).expect("write test executable"); |
| 810 | |
| 811 | #[cfg(unix)] |
| 812 | { |
| 813 | let mut permissions = fs::metadata(path) |
| 814 | .expect("test executable metadata") |
| 815 | .permissions(); |
| 816 | permissions.set_mode(0o755); |
| 817 | fs::set_permissions(path, permissions).expect("set test executable permissions"); |
| 818 | } |
| 819 | } |
| 820 | |
| 821 | #[test] |
| 822 | fn yarn_major_one_maps_to_yarn_package_spec() { |