summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2022-10-14 21:46:37 +0200
committerJens Geyer <jensg@apache.org>2022-10-16 12:04:49 +0200
commit0b1e9513b4fd22b0b382d848cff5201d6d94a06a (patch)
treed3c6b56a2c474432e5b42a84bfc0c9f14b7e6ec3 /test
parentec0141cc550e3ab7c8abb086e41407d145c44c19 (diff)
downloadthrift-0b1e9513b4fd22b0b382d848cff5201d6d94a06a.tar.gz
THRIFT-5652 IDL uuid literals can be improved
Compiler (general) Patch: Jens Geyer This closes #2714
Diffstat (limited to 'test')
-rw-r--r--test/ConstantsDemo.thrift15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/ConstantsDemo.thrift b/test/ConstantsDemo.thrift
index e03f0537d..2245657f6 100644
--- a/test/ConstantsDemo.thrift
+++ b/test/ConstantsDemo.thrift
@@ -22,8 +22,9 @@ namespace erl consts_
namespace haxe constantsDemo
struct thing {
- 1: i32 hello,
- 2: i32 goodbye
+ 1: i32 hello,
+ 2: i32 goodbye
+ 3: uuid id
}
enum enumconstants {
@@ -52,6 +53,10 @@ const string GEN_STRING = "asldkjasfd"
const double e10 = 1e10 // fails with 0.9.3 and earlier
const double e11 = -1e10
+// uuids are accepted with or without curly braces
+const uuid GEN_UUID = '00000000-4444-CCCC-ffff-0123456789ab'
+const uuid GEN_GUID = '{00112233-4455-6677-8899-aaBBccDDeeFF}'
+
const map<i32,i32> GEN_MAP = { 35532 : 233, 43523 : 853 }
const list<i32> GEN_LIST = [ 235235, 23598352, 3253523 ]
@@ -59,13 +64,13 @@ const map<i32, map<i32, i32>> GEN_MAPMAP = { 235 : { 532 : 53255, 235:235}}
const map<string,i32> GEN_MAP2 = { "hello" : 233, "lkj98d" : 853, 'lkjsdf' : 098325 }
-const thing GEN_THING = { 'hello' : 325, 'goodbye' : 325352 }
+const thing GEN_THING = { 'hello' : 325, 'goodbye' : 325352, 'id' : '{00112233-4455-6677-8899-aaBBccDDeeFF}' }
-const map<i32,thing> GEN_WHAT = { 35 : { 'hello' : 325, 'goodbye' : 325352 } }
+const map<i32,thing> GEN_WHAT = { 35 : { 'hello' : 325, 'goodbye' : 325352, 'id' : '00000000-4444-CCCC-ffff-0123456789ab' } }
const set<i32> GEN_SET = [ 235, 235, 53235 ]
-const uuid GEN_UUID = "00000000-4444-CCCC-ffff-0123456789ab"
+const set<uuid> GUID_SET = [ '{00112233-4455-6677-8899-aaBBccDDeeFF}', '00000000-4444-CCCC-ffff-0123456789ab' ]
exception Blah {
1: i32 bing }