MCPcopy Create free account
hub / github.com/apache/datafusion / unescape_readline_input

Function unescape_readline_input

datafusion-cli/src/helper.rs:234–304  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232
233 #[test]
234 fn unescape_readline_input() -> Result<()> {
235 let validator = CliHelper::default();
236
237 // should be valid
238 let result = readline_direct(
239 Cursor::new(
240 r"create external table test stored as csv location 'data.csv' options ('format.delimiter' ',');"
241 .as_bytes(),
242 ),
243 &validator,
244 )?;
245 assert!(matches!(result, ValidationResult::Valid(None)));
246
247 let result = readline_direct(
248 Cursor::new(
249 r"create external table test stored as csv location 'data.csv' options ('format.delimiter' '\0');"
250 .as_bytes()),
251 &validator,
252 )?;
253 assert!(matches!(result, ValidationResult::Valid(None)));
254
255 let result = readline_direct(
256 Cursor::new(
257 r"create external table test stored as csv location 'data.csv' options ('format.delimiter' '\n');"
258 .as_bytes()),
259 &validator,
260 )?;
261 assert!(matches!(result, ValidationResult::Valid(None)));
262
263 let result = readline_direct(
264 Cursor::new(
265 r"create external table test stored as csv location 'data.csv' options ('format.delimiter' '\r');"
266 .as_bytes()),
267 &validator,
268 )?;
269 assert!(matches!(result, ValidationResult::Valid(None)));
270
271 let result = readline_direct(
272 Cursor::new(
273 r"create external table test stored as csv location 'data.csv' options ('format.delimiter' '\t');"
274 .as_bytes()),
275 &validator,
276 )?;
277 assert!(matches!(result, ValidationResult::Valid(None)));
278
279 let result = readline_direct(
280 Cursor::new(
281 r"create external table test stored as csv location 'data.csv' options ('format.delimiter' '\\');"
282 .as_bytes()),
283 &validator,
284 )?;
285 assert!(matches!(result, ValidationResult::Valid(None)));
286
287 let result = readline_direct(
288 Cursor::new(
289 r"create external table test stored as csv location 'data.csv' options ('format.delimiter' ',,');"
290 .as_bytes()),
291 &validator,

Callers

nothing calls this directly

Calls 2

readline_directFunction · 0.85
newFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…