#[cfg(test)]
use crate::lex::lex;
#[cfg(test)]
use crate::prelude::*;
#[cfg(test)]
use crate::scan::scan;
#[test]
fn scan_cmp() {
assert_eq!(
scan("hh \"hello world\"hhhhh hello\"hello there \" \"hello\"".to_string()),
vec![
"hh",
"hello world",
"hhhhh",
"hello",
"hello there ",
"hello"
]
)
}
#[test]
fn lex_cmp() {
for (right, left) in lex(scan("hh 43 \"Hello, world!\" 3.3".to_string()))
.iter()
.zip(vec![
Argument::String("hh".to_string()),
Argument::Integer(43),
Argument::String("Hello, world!".to_string()),
Argument::Float(3.3),
])
{
assert_eq!(right, &left);
}
}
#[test]
fn pop_arg() {
let mut arguments = vec![Argument::String("Hello, World!".to_string())];
arguments.pop_arg().unwrap();
arguments.pop_arg().unwrap_err();
}
#[test]
fn parse() {
let console = Console::new(HashMap::new(), "");
console.parse("help \"hello, world\"".to_string()).unwrap();
}