-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for parsing empty string operands
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'''This is solely to test whether commands with the empty string as an operand | ||
such as echo "" function properly''' | ||
|
||
from pash_annotations.datatypes.CommandInvocationInitial import CommandInvocationInitial | ||
from pash_annotations.parser.parser import parse | ||
|
||
def test_empty_str_1(): | ||
parser_result = parse('echo ""') | ||
|
||
args = [] | ||
operands = [] | ||
expected_result = CommandInvocationInitial("echo", args, operands) | ||
|
||
assert expected_result == parser_result | ||
|
||
def test_empty_str_2(): | ||
parser_result = parse('cat ""') | ||
|
||
args = [] | ||
operands = [] | ||
expected_result = CommandInvocationInitial("cat", args, operands) | ||
|
||
assert expected_result == parser_result |