mirror of
https://github.com/nushell/nushell
synced 2024-12-30 15:03:25 +00:00
11 lines
232 B
Rust
11 lines
232 B
Rust
use nu_test_support::nu;
|
|
|
|
#[test]
|
|
fn while_sum() {
|
|
let actual = nu!(
|
|
cwd: ".",
|
|
"mut total = 0; mut x = 0; while $x <= 10 { $total = $total + $x; $x = $x + 1 }; $total"
|
|
);
|
|
|
|
assert_eq!(actual.out, "55");
|
|
}
|