Line data Source code
1 : /* Copyright 2017 noseglasses <shinynoseglasses@gmail.com>
2 : *
3 : * This program is free software: you can redistribute it and/or modify
4 : * it under the terms of the GNU Lesser General Public License as published by
5 : * the Free Software Foundation, either version 3 of the License, or
6 : * (at your option) any later version.
7 : *
8 : * This program is distributed in the hope that it will be useful,
9 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 : * GNU Lesser General Public License for more details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 : */
16 :
17 : #include "papageno_char_strings.h"
18 :
19 : enum {
20 : ppg_cs_layer_0 = 0
21 : };
22 :
23 1 : PPG_CS_START_TEST
24 :
25 1 : PPG_CS_REGISTER_ACTION(Fallback_Action)
26 1 : PPG_CS_REGISTER_ACTION(Actual_Action)
27 :
28 1 : ppg_pattern(
29 : ppg_cs_layer_0, /* Layer id */
30 1 : PPG_TOKENS(
31 : PPG_CS_N('a'),
32 : ppg_token_set_action_flags(
33 : ppg_token_set_action(
34 : PPG_CS_N('b'),
35 : PPG_CS_ACTION(Fallback_Action)
36 : ),
37 : PPG_Action_Fallback
38 : ),
39 : ppg_token_set_action_flags(
40 : ppg_token_set_action(
41 : PPG_CS_N('c'),
42 : PPG_CS_ACTION(Actual_Action)
43 : ),
44 : PPG_Action_Fallback
45 : )
46 : )
47 : );
48 :
49 1 : ppg_cs_compile();
50 :
51 1 : PPG_CS_PROCESS_ON_OFF( "a b c",
52 : PPG_CS_EXPECT_EMPTY_FLUSH
53 : PPG_CS_EXPECT_NO_EXCEPTIONS
54 : PPG_CS_EXPECT_ACTION_SERIES(
55 : PPG_CS_A(Fallback_Action),
56 : PPG_CS_A(Actual_Action)
57 : )
58 : );
59 :
60 1 : PPG_CS_PROCESS_ON_OFF( "a b |",
61 : PPG_CS_EXPECT_EMPTY_FLUSH
62 : PPG_CS_EXPECT_EXCEPTIONS(PPG_CS_ET)
63 : PPG_CS_EXPECT_ACTION_SERIES(
64 : PPG_CS_A(Fallback_Action)
65 : )
66 : );
67 :
68 1 : PPG_CS_END_TEST
|