Fix more command tests (#4481)

This commit is contained in:
JT
2022-02-15 10:08:07 -05:00
committed by GitHub
parent 5c1a1be02b
commit 66669d7839
5 changed files with 20 additions and 30 deletions

View File

@ -115,7 +115,15 @@ fn extract_headers(value: &Value, config: &Config) -> Result<Vec<String>, ShellE
match value {
Value::Record { vals, .. } => Ok(vals
.iter()
.map(|value| value.into_string("", config))
.enumerate()
.map(|(idx, value)| {
let col = value.into_string("", config);
if col.is_empty() {
format!("Column{}", idx)
} else {
col
}
})
.collect::<Vec<String>>()),
Value::List { vals, span } => vals
.iter()