Debian Codegraph @

Tests/RunCMake/string/Repeat.cmake

raw
1 string(REPEAT "q" 4 q_out)
2
3 if(NOT DEFINED q_out)
4 message(FATAL_ERROR "q_out is not defined")
5 endif()
6
7 if(NOT q_out STREQUAL "qqqq")
8 message(FATAL_ERROR "unexpected result")
9 endif()
10
11 string(REPEAT "1234" 0 zero_out)
12
13 if(NOT DEFINED zero_out)
14 message(FATAL_ERROR "zero_out is not defined")
15 endif()
16
17 if(NOT zero_out STREQUAL "")
18 message(FATAL_ERROR "unexpected result")
19 endif()
20
21 unset(zero_out)
22
23 string(REPEAT "" 100 zero_out)
24
25 if(NOT DEFINED zero_out)
26 message(FATAL_ERROR "zero_out is not defined")
27 endif()
28
29 if(NOT zero_out STREQUAL "")
30 message(FATAL_ERROR "unexpected result")
31 endif()
32
33 string(REPEAT "1" 1 one_out)
34
35 if(NOT one_out STREQUAL "1")
36 message(FATAL_ERROR "unexpected result")
37 endif()
38
39 unset(one_out)
40
41 string(REPEAT "one" 1 one_out)
42
43 if(NOT one_out STREQUAL "one")
44 message(FATAL_ERROR "unexpected result")
45 endif()