Remove old nushell/merge engine-q

This commit is contained in:
JT
2022-02-07 14:54:06 -05:00
parent 10c4c50f1f
commit d70d91e559
430 changed files with 14543 additions and 7865 deletions

View File

@ -18,15 +18,8 @@ fn can_average_numbers() {
fn can_average_bytes() {
let actual = nu!(
cwd: "tests/fixtures/formats",
<<<<<<< HEAD
"ls | sort-by name | skip 1 | first 2 | get size | math avg | format \"{$it}\" "
);
assert_eq!(actual.out, "1.6 KB");
=======
"ls | sort-by name | skip 1 | first 2 | get size | math avg | to json -r"
);
assert_eq!(actual.out, "1600");
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
}

View File

@ -1,10 +1,7 @@
use nu_test_support::{nu, pipeline};
<<<<<<< HEAD
=======
// FIXME: jt: needs more work
#[ignore]
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
#[test]
fn evaluates_two_plus_two() {
let actual = nu!(
@ -17,11 +14,8 @@ fn evaluates_two_plus_two() {
assert!(actual.out.contains("4.0"));
}
<<<<<<< HEAD
=======
// FIXME: jt: needs more work
#[ignore]
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
#[test]
fn evaluates_two_to_the_power_four() {
let actual = nu!(
@ -34,11 +28,8 @@ fn evaluates_two_to_the_power_four() {
assert!(actual.out.contains("16.0"));
}
<<<<<<< HEAD
=======
// FIXME: jt: needs more work
#[ignore]
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
#[test]
fn evaluates_three_multiplied_by_five() {
let actual = nu!(
@ -51,11 +42,8 @@ fn evaluates_three_multiplied_by_five() {
assert!(actual.out.contains("15.0"));
}
<<<<<<< HEAD
=======
// FIXME: jt: needs more work
#[ignore]
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
#[test]
fn evaluates_twenty_four_divided_by_two() {
let actual = nu!(

View File

@ -0,0 +1,40 @@
use nu_test_support::{nu, pipeline};
#[test]
fn median_numbers_with_even_rows() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo [10 6 19 21 4]
| math median
"#
));
assert_eq!(actual.out, "10")
}
#[test]
fn median_numbers_with_odd_rows() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo [3 8 9 12 12 15]
| math median
"#
));
assert_eq!(actual.out, "10.5")
}
#[test]
fn median_mixed_numbers() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo [-11.5 -13.5 10]
| math median
"#
));
assert_eq!(actual.out, "-11.5")
}

View File

@ -236,21 +236,6 @@ fn duration_math_with_negative() {
}
#[test]
<<<<<<< HEAD
fn duration_math_shell_error_on_big_numbers() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
(date now) + 100000000000000day
"#
));
assert!(actual.err.contains("Duration overflow"));
}
#[test]
=======
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
fn compound_comparison() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
@ -279,19 +264,11 @@ fn compound_where() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
<<<<<<< HEAD
echo '[{"a": 1, "b": 1}, {"a": 2, "b": 1}, {"a": 2, "b": 2}]' | from json | where a == 2 && b == 1 | to json
"#
));
assert_eq!(actual.out, r#"{"a":2,"b":1}"#);
=======
echo '[{"a": 1, "b": 1}, {"a": 2, "b": 1}, {"a": 2, "b": 2}]' | from json | where a == 2 && b == 1 | to json -r
"#
));
assert_eq!(actual.out, r#"[{"a": 2,"b": 1}]"#);
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
}
#[test]
@ -299,17 +276,9 @@ fn compound_where_paren() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
<<<<<<< HEAD
echo '[{"a": 1, "b": 1}, {"a": 2, "b": 1}, {"a": 2, "b": 2}]' | from json | where ($it.a == 2 && $it.b == 1) || $it.b == 2 | to json
"#
));
assert_eq!(actual.out, r#"[{"a":2,"b":1},{"a":2,"b":2}]"#);
=======
echo '[{"a": 1, "b": 1}, {"a": 2, "b": 1}, {"a": 2, "b": 2}]' | from json | where ($it.a == 2 && $it.b == 1) || $it.b == 2 | to json -r
"#
));
assert_eq!(actual.out, r#"[{"a": 2,"b": 1},{"a": 2,"b": 2}]"#);
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
}

View File

@ -0,0 +1,21 @@
use nu_test_support::nu;
#[test]
fn can_round_very_large_numbers() {
let actual = nu!(
cwd: ".",
"echo 18.1372544780074142289927665486772012345 | math round"
);
assert_eq!(actual.out, "18")
}
#[test]
fn can_round_very_large_numbers_with_precision() {
let actual = nu!(
cwd: ".",
"echo 18.13725447800741422899276654867720121457878988 | math round -p 10"
);
assert_eq!(actual.out, "18.137254478")
}

View File

@ -1,10 +1,7 @@
use nu_test_support::nu;
<<<<<<< HEAD
=======
// FIXME: jt: needs more work
#[ignore]
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
#[test]
fn can_sqrt_numbers() {
let actual = nu!(
@ -15,11 +12,8 @@ fn can_sqrt_numbers() {
assert_eq!(actual.out, "3.914213562373095048801688724209698078569671875376948073176679737990732478462107038850387534327641573");
}
<<<<<<< HEAD
=======
// FIXME: jt: needs more work
#[ignore]
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
#[test]
fn can_sqrt_irrational() {
let actual = nu!(

View File

@ -75,11 +75,8 @@ fn compute_sum_of_table() -> Result<(), String> {
Ok(())
}
<<<<<<< HEAD
=======
// FIXME: jt: needs more work
#[ignore]
>>>>>>> 9259a56a28f1dd3a4b720ad815aa19c6eaf6adce
#[test]
fn sum_of_a_row_containing_a_table_is_an_error() {
let actual = nu!(