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

Function test_decode

datafusion/spark/src/function/url/url_decode.rs:210–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208
209 #[test]
210 fn test_decode() -> Result<()> {
211 let input = Arc::new(StringArray::from(vec![
212 Some("https%3A%2F%2Fspark.apache.org"),
213 Some("inva+lid://user:pass@host/file\\;param?query\\;p2"),
214 Some("inva lid://user:pass@host/file\\;param?query\\;p2"),
215 Some("%7E%21%40%23%24%25%5E%26%2A%28%29%5F%2B"),
216 Some("%E4%BD%A0%E5%A5%BD"),
217 Some(""),
218 None,
219 ]));
220 let expected = StringArray::from(vec![
221 Some("https://spark.apache.org"),
222 Some("inva lid://user:pass@host/file\\;param?query\\;p2"),
223 Some("inva lid://user:pass@host/file\\;param?query\\;p2"),
224 Some("~!@#$%^&*()_+"),
225 Some("你好"),
226 Some(""),
227 None,
228 ]);
229
230 let result = spark_url_decode(&[input as ArrayRef])?;
231 let result = as_string_array(&result)?;
232
233 assert_eq!(&expected, result);
234
235 Ok(())
236 }
237
238 #[test]
239 fn test_decode_error() -> Result<()> {

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
spark_url_decodeFunction · 0.85
as_string_arrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…