Skip to content

Commit

Permalink
Add test for parsing empty string operands
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyerunix authored Jul 12, 2024
1 parent d7bc303 commit 99b6aba
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pash_annotations/parser/tests/test_parser_empty_str.py
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

0 comments on commit 99b6aba

Please sign in to comment.