(input: &str, escaped: bool, expected_str: &str)
| 129 | #[test] |
| 130 | fn quotes() { |
| 131 | fn test_basic_string(input: &str, escaped: bool, expected_str: &str) { |
| 132 | let parse_result = quoted_string(escaped).parse(input); |
| 133 | if let Some(result) = parse_result.output() { |
| 134 | assert_eq!(result, expected_str); |
| 135 | } else { |
| 136 | panic!("Failed to parse string: {:?}", input); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | test_basic_string(r#"'aoeu'"#, false, "aoeu"); |
| 141 | test_basic_string(r#"''"#, true, ""); |
no test coverage detected