blob: b06659f4df0c9530b0f92eaa14debd3595c5efae [file] [log] [blame]
Jens Geyer944b8e62022-09-11 12:30:35 +02001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
Jens Geyer6f86f9a2014-07-08 21:31:52 +020020// Naming testcases, sepcifically for these tickets (but not limited to them)
21// THRIFT-2508 Uncompileable C# code due to language keywords in IDL
22// THRIFT-2557 error CS0542 member names cannot be the same as their enclosing type
23
24
25struct using {
Jens Geyeraaa89472014-10-03 20:22:28 +020026 1: double single
27 2: double integer
Jens Geyer6f86f9a2014-07-08 21:31:52 +020028}
29
30struct delegate {
Jens Geyeraaa89472014-10-03 20:22:28 +020031 1: string partial
32 2: delegate delegate
Jens Geyer6f86f9a2014-07-08 21:31:52 +020033}
34
35struct get {
Jens Geyeraaa89472014-10-03 20:22:28 +020036 1: bool sbyte
Jens Geyer6f86f9a2014-07-08 21:31:52 +020037}
38
39struct partial {
Jens Geyeraaa89472014-10-03 20:22:28 +020040 1: using using
henrique2f34da72015-02-05 12:39:34 +110041 2: bool read
42 3: bool write
Jens Geyer6f86f9a2014-07-08 21:31:52 +020043}
44
Roger Meier16c164e2014-08-07 03:09:23 +020045enum Maybe {
46 JUST = 1,
47 TRUE = 2,
48 FALSE = 3
49}
50
51enum Either {
52 LEFT = 1,
53 RIGHT = 2
54}
55
56struct foldr {
57 1: string id
58}
59
60struct of {
61 1: string let
62 2: string where
63}
Jens Geyer6f86f9a2014-07-08 21:31:52 +020064
alisdair sullivanca44a622014-08-07 06:32:37 -070065struct ofOf {
66 1: of Of
67}
68
Jens Geyer6f86f9a2014-07-08 21:31:52 +020069
70struct ClassAndProp {
71 1: bool ClassAndProp
72 2: bool ClassAndProp_
73 3: bool ClassAndProp__
74 4: bool ClassAndProper
75}
76
77struct second_chance {
78 1: bool SECOND_CHANCE
79 2: bool SECOND_CHANCE_
80 3: bool SECOND_CHANCE__
81 4: bool SECOND_CHANCES
82}
83
84struct NOW_EAT_THIS {
85 1: bool now_eat_this
86 2: bool now_eat_this_
87 3: bool now_eat_this__
88 4: bool now_eat_this_and_this
89}
90
91struct TheEdgeCase {
92 1: bool theEdgeCase
93 2: bool theEdgeCase_
94 3: bool theEdgeCase__
95 4: bool TheEdgeCase
96 5: bool TheEdgeCase_
97 6: bool TheEdgeCase__
98}
99
100struct Tricky_ {
101 1: bool tricky
102 2: bool Tricky
103}
104
105struct Nested {
Jens Geyeraaa89472014-10-03 20:22:28 +0200106 1: ClassAndProp ClassAndProp
107 2: second_chance second_chance
108 3: NOW_EAT_THIS NOW_EAT_THIS
109 4: TheEdgeCase TheEdgeCase
110 5: Tricky_ Tricky_
Jens Geyer6f86f9a2014-07-08 21:31:52 +0200111 6: Nested Nested
112}
113
114exception Problem_ {
115 1: bool problem
116 2: bool Problem
117}
118
Jens Geyer154d1542022-09-10 14:30:15 +0200119struct Thrift5626 {
120 1: i8 i8
121 2: i16 i16
122 3: i32 i32
123 4: i64 i64
124 5: uuid uuid
125 6: string string
126 7: binary binary
127 8: bool bool
128 9: byte byte
129 10: list<string> list
130 11: set<string> set
131 12: map<string,string> map
132}
Jens Geyer6f86f9a2014-07-08 21:31:52 +0200133
134service extern {
Jens Geyeraaa89472014-10-03 20:22:28 +0200135 delegate event(1: partial get)
136 void Foo(1: Nested Foo_args) throws (1: Problem_ Foo_result)
Jens Geyer6f86f9a2014-07-08 21:31:52 +0200137}
138
Roger Meier16c164e2014-08-07 03:09:23 +0200139service qualified {
Jens Geyeraaa89472014-10-03 20:22:28 +0200140 Maybe maybe(1: Maybe foldr)
141 Either either(1: foldr of)
Roger Meier16c164e2014-08-07 03:09:23 +0200142}
Jens Geyer6f86f9a2014-07-08 21:31:52 +0200143// eof