Move command changes. Refactorings. (#2683)

Continuing on anchoring and improvements on Nu's overall internal commands (#2635).
`move column` sub command has been turned into the command `move` since
we use it to move exclusively columns. Examples added as well.

Fixed it to carry along any anchor locations that might be in place if
table to be moved originates from other sources.
This commit is contained in:
Andrés N. Robalino
2020-10-20 04:07:13 -05:00
committed by GitHub
parent bc6c884a14
commit b6d19cc9fa
49 changed files with 516 additions and 625 deletions

View File

@ -127,7 +127,7 @@ fn build_xpath(xpath_str: &str) -> Result<sxd_xpath::XPath, ShellError> {
mod tests {
use super::string_to_value as query;
use nu_errors::ShellError;
use nu_source::{Span, TaggedItem};
use nu_source::TaggedItem;
use nu_test_support::value::{decimal_from_float, row};
use indexmap::indexmap;
@ -140,9 +140,7 @@ mod tests {
assert_eq!(
actual[0],
row(
indexmap! { "count(//a/*[posit...".into() => decimal_from_float(1.0, Span::unknown()) }
)
row(indexmap! { "count(//a/*[posit...".into() => decimal_from_float(1.0) })
);
Ok(())
@ -156,9 +154,7 @@ mod tests {
assert_eq!(
actual[0],
row(
indexmap! { "count(//*[contain...".into() => decimal_from_float(1.0, Span::unknown()) }
)
row(indexmap! { "count(//*[contain...".into() => decimal_from_float(1.0) })
);
Ok(())