2019-02-13 11:24:14 +00:00
|
|
|
#!/usr/bin/env python3
|
2022-05-10 10:06:48 +00:00
|
|
|
# Copyright (C) 2018 The Qt Company Ltd.
|
|
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2019-02-13 11:24:14 +00:00
|
|
|
|
2019-10-10 07:58:38 +00:00
|
|
|
from qmake_parser import fixup_linecontinuation
|
2019-02-13 11:24:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_no_change():
|
|
|
|
input = "test \\\nline2\n line3"
|
2019-05-23 13:57:59 +00:00
|
|
|
output = "test line2\n line3"
|
2019-02-13 11:24:14 +00:00
|
|
|
result = fixup_linecontinuation(input)
|
2019-05-23 13:57:59 +00:00
|
|
|
assert output == result
|
2019-02-13 11:24:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_fix():
|
|
|
|
input = "test \\\t\nline2\\\n line3\\ \nline4 \\ \t\nline5\\\n\n\n"
|
2019-05-23 13:57:59 +00:00
|
|
|
output = "test line2 line3 line4 line5 \n\n"
|
2019-02-13 11:24:14 +00:00
|
|
|
result = fixup_linecontinuation(input)
|
2019-05-23 13:57:59 +00:00
|
|
|
assert output == result
|