remove the boolean vars (#4879)

This commit is contained in:
JT 2022-03-20 08:12:10 +13:00 committed by GitHub
parent f3bb1d11d3
commit bd5778fa24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 32 deletions

View file

@ -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
"# "#
)); ));

View file

@ -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,

View file

@ -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")