fix: command open sets default flags when calling "from xxx" converters (#15383)

Fixes #13722

# Description

Simple solution: `eval_block` -> `eval_call` with empty arguments

# User-Facing Changes

Should be none.

# Tests + Formatting

+1

# After Submitting
This commit is contained in:
zc he
2025-03-26 00:40:20 +08:00
committed by GitHub
parent bf1f2d5ebd
commit e10ac2ede6
2 changed files with 29 additions and 9 deletions

View File

@ -300,6 +300,20 @@ fn test_open_block_command() {
assert_eq!(actual.out, "abcd")
}
#[test]
fn test_open_with_converter_flags() {
// https://github.com/nushell/nushell/issues/13722
let actual = nu!(
cwd: "tests/fixtures/formats",
r#"
def "from blockcommandparser" [ --flag ] { if $flag { "yes" } else { "no" } }
open sample.blockcommandparser
"#
);
assert_eq!(actual.out, "no")
}
#[test]
fn open_ignore_ansi() {
Playground::setup("open_test_ansi", |dirs, sandbox| {