mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
remove the boolean vars (#4879)
This commit is contained in:
parent
f3bb1d11d3
commit
bd5778fa24
3 changed files with 2 additions and 32 deletions
|
@ -156,7 +156,7 @@ fn read_bool() {
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
cwd: "tests/fixtures/formats", pipeline(
|
cwd: "tests/fixtures/formats", pipeline(
|
||||||
r#"
|
r#"
|
||||||
open sample.nuon | get 3 | $in == $true
|
open sample.nuon | get 3 | $in == true
|
||||||
"#
|
"#
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -1590,27 +1590,7 @@ pub fn parse_variable_expr(
|
||||||
) -> (Expression, Option<ParseError>) {
|
) -> (Expression, Option<ParseError>) {
|
||||||
let contents = working_set.get_span_contents(span);
|
let contents = working_set.get_span_contents(span);
|
||||||
|
|
||||||
if contents == b"$true" {
|
if contents == b"$nothing" {
|
||||||
return (
|
|
||||||
Expression {
|
|
||||||
expr: Expr::Bool(true),
|
|
||||||
span,
|
|
||||||
ty: Type::Bool,
|
|
||||||
custom_completion: None,
|
|
||||||
},
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
} else if contents == b"$false" {
|
|
||||||
return (
|
|
||||||
Expression {
|
|
||||||
expr: Expr::Bool(false),
|
|
||||||
span,
|
|
||||||
ty: Type::Bool,
|
|
||||||
custom_completion: None,
|
|
||||||
},
|
|
||||||
None,
|
|
||||||
);
|
|
||||||
} else if contents == b"$nothing" {
|
|
||||||
return (
|
return (
|
||||||
Expression {
|
Expression {
|
||||||
expr: Expr::Nothing,
|
expr: Expr::Nothing,
|
||||||
|
|
|
@ -278,16 +278,6 @@ fn open_ended_range() -> TestResult {
|
||||||
run_test(r#"1.. | first 100000 | length"#, "100000")
|
run_test(r#"1.. | first 100000 | length"#, "100000")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn bool_variable() -> TestResult {
|
|
||||||
run_test(r#"$true"#, "true")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn bool_variable2() -> TestResult {
|
|
||||||
run_test(r#"$false"#, "false")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn default_value1() -> TestResult {
|
fn default_value1() -> TestResult {
|
||||||
run_test(r#"def foo [x = 3] { $x }; foo"#, "3")
|
run_test(r#"def foo [x = 3] { $x }; foo"#, "3")
|
||||||
|
|
Loading…
Reference in a new issue