# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
set(ts_file "test_i18n_exclusion_de.ts")
file(READ "${ts_file}" ts_file_content)
set(expected_strings
"Hello from app1!"
"Hello from MyObject1!"
)
foreach(needle IN LISTS expected_strings)
string(FIND "${ts_file_content}" "${needle}" pos)
if(pos EQUAL "-1")
message(FATAL_ERROR
"Expected string '${needle}' was not found in '${ts_file}'. "
"The file content is:\n${ts_file_content}"
)
endif()
endforeach()
set(forbidden_strings
"Hello from MyObject2!"
"Hello from test1!"
"excluded1"
"excluded2"
"excluded3"
"excluded4"
"excluded5"
)
foreach(needle IN LISTS forbidden_strings)
string(FIND "${ts_file_content}" "${needle}" pos)
if(NOT pos EQUAL "-1")
message(FATAL_ERROR
"Excluded string '${needle}' was found in '${ts_file}'. "
"The file content is:\n${ts_file_content}"
)
endif()
endforeach()