Skip to content
Snippets Groups Projects
Commit dcf4f7f7 authored by Christoph Alt's avatar Christoph Alt
Browse files

HeaderFile.parse now removes a leading and a trailing " if it gets a

string alreading containing the parentheses
parent 5e034586
No related merge requests found
Pipeline #71503 passed with stages
in 10 minutes and 9 seconds
......@@ -24,6 +24,9 @@ class HeaderFile:
return header
system_header = False
if header.startswith('"') and header.endswith('"'):
header = header[1:-1]
if header.startswith("<") and header.endswith(">"):
header = header[1:-1]
system_header = True
......
from pystencilssfg.lang import HeaderFile
import pytest
def test_parse_system():
headerfile = HeaderFile.parse("<test>")
assert str(headerfile) == "<test>" and headerfile.system_header
@pytest.mark.parametrize("header_string", ["test.hpp", '"test.hpp"'])
def test_parse_private(header_string):
headerfile = HeaderFile.parse(header_string)
assert str(headerfile) == "test.hpp" and not headerfile.system_header
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment