Fix tests

This commit is contained in:
Jonathan Turner 2019-11-18 06:38:44 +13:00
parent 2bb03d9813
commit c598cd4255

View file

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