mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-24 19:29:57 +00:00
support escaped arrays and functions
This commit is contained in:
@ -68,7 +68,7 @@ def test_parse_array_comment() -> None:
|
||||
])]
|
||||
|
||||
|
||||
def test_parse_array_quotes() -> None:
|
||||
def test_parse_array_escaped() -> None:
|
||||
"""
|
||||
must correctly process quoted brackets
|
||||
"""
|
||||
@ -81,6 +81,9 @@ def test_parse_array_quotes() -> None:
|
||||
parser = PkgbuildParser(StringIO("""var=(first ')' second)"""))
|
||||
assert list(parser.parse()) == [PkgbuildPatch("var", ["first", ")", "second"])]
|
||||
|
||||
parser = PkgbuildParser(StringIO("""var=(first \\) second)"""))
|
||||
assert list(parser.parse()) == [PkgbuildPatch("var", ["first", ")", "second"])]
|
||||
|
||||
|
||||
def test_parse_array_exception() -> None:
|
||||
"""
|
||||
@ -123,7 +126,7 @@ def test_parse_function_inner_shell() -> None:
|
||||
assert list(parser.parse()) == [PkgbuildPatch("var()", "{ { echo hello world } }")]
|
||||
|
||||
|
||||
def test_parse_function_quotes() -> None:
|
||||
def test_parse_function_escaped() -> None:
|
||||
"""
|
||||
must parse function with bracket in quotes
|
||||
"""
|
||||
@ -142,6 +145,9 @@ def test_parse_function_quotes() -> None:
|
||||
parser = PkgbuildParser(StringIO("""var ( ) { echo hello world '}' } """))
|
||||
assert list(parser.parse()) == [PkgbuildPatch("var()", """{ echo hello world '}' }""")]
|
||||
|
||||
parser = PkgbuildParser(StringIO("""var ( ) { echo hello world \\} } """))
|
||||
assert list(parser.parse()) == [PkgbuildPatch("var()", """{ echo hello world \\} }""")]
|
||||
|
||||
|
||||
def test_parse_function_exception() -> None:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user