Add subcommand test

This commit is contained in:
JT 2021-08-09 09:55:18 +12:00
parent 273f964293
commit 38fef28c84
2 changed files with 6 additions and 0 deletions

View File

@ -805,6 +805,7 @@ impl<'a> ParserWorkingSet<'a> {
Some(ParseError::UnknownCommand(spans[0])), Some(ParseError::UnknownCommand(spans[0])),
); );
} }
let name = self.get_span_contents(spans[pos]); let name = self.get_span_contents(spans[pos]);
pos += 1; pos += 1;

View File

@ -133,3 +133,8 @@ fn env_shorthand() -> TestResult {
fn floating_add() -> TestResult { fn floating_add() -> TestResult {
run_test("10.1 + 0.8", "10.9") run_test("10.1 + 0.8", "10.9")
} }
#[test]
fn subcommand() -> TestResult {
run_test("def foo [] {}; def \"foo bar\" [] {3}; foo bar", "3")
}