(s: &str)
| 148 | } |
| 149 | |
| 150 | fn parse_expected_string(s: &str) -> String { |
| 151 | if s.starts_with("r\"") && s.ends_with('"') { |
| 152 | // If it's a raw string (r"..."), treat contents literally |
| 153 | s[2..s.len() - 1].to_string() |
| 154 | } else if s.starts_with('"') && s.ends_with('"') { |
| 155 | // If it's a regular quoted string, unescape its contents |
| 156 | let inner = &s[1..s.len() - 1]; |
| 157 | unescape_string(inner) |
| 158 | } else { |
| 159 | // If not quoted, treat it as a literal string |
| 160 | s.to_string() |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | fn unescape_string(s: &str) -> String { |
| 165 | let mut result = String::with_capacity(s.len()); |
no test coverage detected