extern crate conch_parser; use conch_parser::ast::*; use conch_parser::ast::ComplexWord::*; use conch_parser::ast::SimpleWord::*; use conch_parser::ast::Redirect::Heredoc; use conch_parser::parse::ParseError::*; use conch_parser::token::Token; mod parse_support; use parse_support::*; fn cat_heredoc(fd: Option, body: &'static str) -> TopLevelCommand { cmd_from_simple(SimpleCommand { redirects_or_env_vars: vec!(), redirects_or_cmd_words: vec!( RedirectOrCmdWord::CmdWord(word("cat")), RedirectOrCmdWord::Redirect(Heredoc(fd, word(body))), ), }) } #[test] fn test_heredoc_valid() { let correct = Some(cat_heredoc(None, "hello\n")); assert_eq!(correct, make_parser("cat <