mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 00:07:46 +02:00
Move most of the root package into a subcrate. (#1445)
This improves incremental build time when working on what was previously the root package. For example, previously all plugins would be rebuilt with a change to `src/commands/classified/external.rs`, but now only `nu-cli` will have to be rebuilt (and anything that depends on it).
This commit is contained in:
49
crates/nu-cli/tests/commands/calc.rs
Normal file
49
crates/nu-cli/tests/commands/calc.rs
Normal file
@ -0,0 +1,49 @@
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[test]
|
||||
fn calculates_two_plus_two() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo "2 + 2" | calc
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.contains("4.0"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn calculates_two_to_the_power_six() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo "2 ^ 6" | calc
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.contains("64.0"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn calculates_three_multiplied_by_five() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo "3 * 5" | calc
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.contains("15.0"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn calculates_twenty_four_divided_by_two() {
|
||||
let actual = nu!(
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo "24 / 2" | calc
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.contains("12.0"));
|
||||
}
|
Reference in New Issue
Block a user