()
| 140 | |
| 141 | #[test] |
| 142 | fn test_read_home_with_comments() { |
| 143 | let temp_dir = std::env::temp_dir(); |
| 144 | let cfg_path = temp_dir.join("test_pyvenv3.cfg"); |
| 145 | |
| 146 | let mut file = fs::File::create(&cfg_path).unwrap(); |
| 147 | writeln!(file, "# This is a comment").unwrap(); |
| 148 | writeln!(file, "home = D:\\RustPython").unwrap(); |
| 149 | |
| 150 | let home = read_home(&cfg_path).unwrap(); |
| 151 | assert_eq!(home, "D:\\RustPython"); |
| 152 | |
| 153 | fs::remove_file(&cfg_path).unwrap(); |
| 154 | } |
| 155 | } |