mirror of
https://github.com/nushell/nushell
synced 2024-12-27 13:33:16 +00:00
Fix tests
This commit is contained in:
parent
2bb03d9813
commit
c598cd4255
1 changed files with 6 additions and 2 deletions
|
@ -1,12 +1,13 @@
|
||||||
use crate::commands::classified::InternalCommand;
|
use crate::commands::classified::InternalCommand;
|
||||||
use crate::commands::ClassifiedCommand;
|
use crate::commands::ClassifiedCommand;
|
||||||
use crate::env::host::BasicHost;
|
use crate::env::host::BasicHost;
|
||||||
use crate::parser::hir;
|
|
||||||
use crate::parser::hir::syntax_shape::*;
|
use crate::parser::hir::syntax_shape::*;
|
||||||
use crate::parser::hir::TokensIterator;
|
use crate::parser::hir::TokensIterator;
|
||||||
|
use crate::parser::hir::{self, named::NamedValue, NamedArguments};
|
||||||
use crate::parser::parse::token_tree_builder::{CurriedToken, TokenTreeBuilder as b};
|
use crate::parser::parse::token_tree_builder::{CurriedToken, TokenTreeBuilder as b};
|
||||||
use crate::parser::TokenNode;
|
use crate::parser::TokenNode;
|
||||||
use crate::{HasSpan, Span, SpannedItem, Tag, Text};
|
use crate::{HasSpan, Span, SpannedItem, Tag, Text};
|
||||||
|
use indexmap::IndexMap;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
|
@ -67,6 +68,9 @@ fn test_parse_command() {
|
||||||
|
|
||||||
eprintln!("{:?} {:?} {:?}", bare, pat, bare.until(pat));
|
eprintln!("{:?} {:?} {:?}", bare, pat, bare.until(pat));
|
||||||
|
|
||||||
|
let mut map = IndexMap::new();
|
||||||
|
map.insert("full".to_string(), NamedValue::AbsentSwitch);
|
||||||
|
|
||||||
ClassifiedCommand::Internal(InternalCommand::new(
|
ClassifiedCommand::Internal(InternalCommand::new(
|
||||||
"ls".to_string(),
|
"ls".to_string(),
|
||||||
Tag {
|
Tag {
|
||||||
|
@ -76,7 +80,7 @@ fn test_parse_command() {
|
||||||
hir::Call {
|
hir::Call {
|
||||||
head: Box::new(hir::RawExpression::Command(bare).spanned(bare)),
|
head: Box::new(hir::RawExpression::Command(bare).spanned(bare)),
|
||||||
positional: Some(vec![hir::Expression::pattern("*.txt", pat)]),
|
positional: Some(vec![hir::Expression::pattern("*.txt", pat)]),
|
||||||
named: None,
|
named: Some(NamedArguments { named: map }),
|
||||||
}
|
}
|
||||||
.spanned(bare.until(pat)),
|
.spanned(bare.until(pat)),
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in a new issue