05fc3aef53
Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
33 lines
972 B
Python
Executable File
33 lines
972 B
Python
Executable File
#!/usr/bin/env python3
|
|
# Copyright (C) 2018 The Qt Company Ltd.
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
from pro2cmake import AddOperation, SetOperation, UniqueAddOperation, RemoveOperation
|
|
|
|
def test_add_operation():
|
|
op = AddOperation(['bar', 'buz'])
|
|
|
|
result = op.process(['foo', 'bar'], ['foo', 'bar'], lambda x: x)
|
|
assert ['foo', 'bar', 'bar', 'buz'] == result
|
|
|
|
|
|
def test_uniqueadd_operation():
|
|
op = UniqueAddOperation(['bar', 'buz'])
|
|
|
|
result = op.process(['foo', 'bar'], ['foo', 'bar'], lambda x: x)
|
|
assert ['foo', 'bar', 'buz'] == result
|
|
|
|
|
|
def test_set_operation():
|
|
op = SetOperation(['bar', 'buz'])
|
|
|
|
result = op.process(['foo', 'bar'], ['foo', 'bar'], lambda x: x)
|
|
assert ['bar', 'buz'] == result
|
|
|
|
|
|
def test_remove_operation():
|
|
op = RemoveOperation(['bar', 'buz'])
|
|
|
|
result = op.process(['foo', 'bar'], ['foo', 'bar'], lambda x: x)
|
|
assert ['foo', '-buz'] == result
|