xref: /aosp_15_r20/external/icu/icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/message2/test-core.json (revision 0e209d3975ff4a8c132096b14b0e9364a753506e)
1[
2  { "src": "hello", "exp": "hello" },
3  { "src": "hello {world}", "exp": "hello world" },
4  {
5    "src": "hello { world\t\n}",
6    "exp": "hello world",
7    "cleanSrc": "hello {world}"
8  },
9  {
10    "src": "hello {\u3000world\r}",
11    "exp": "hello world",
12    "cleanSrc": "hello {world}"
13  },
14  { "src": "hello {|world|}", "exp": "hello world" },
15  { "src": "hello {||}", "exp": "hello " },
16  {
17    "src": "hello {$place}",
18    "params": { "place": "world" },
19    "exp": "hello world"
20  },
21  {
22    "src": "hello {$place-.}",
23    "params": { "place-.": "world" },
24    "exp": "hello world"
25  },
26  {
27    "src": "hello {$place}",
28    "errorsJs": [{ "type": "unresolved-var" }],
29    "exp": "hello {$place}"
30  },
31  {
32    "src": "{$one} and {$two}",
33    "params": { "one": 1.3, "two": 4.2 },
34    "exp": "1.3 and 4.2"
35  },
36  {
37    "src": "{$one} et {$two}",
38    "locale": "fr",
39    "params": { "one": 1.3, "two": 4.2 },
40    "exp": "1,3 et 4,2"
41  },
42  { "src": ".local $foo = {bar} {{bar {$foo}}}", "exp": "bar bar" },
43  { "src": ".local $foo = {|bar|} {{bar {$foo}}}", "exp": "bar bar" },
44  {
45    "src": ".local $foo = {|bar|} {{bar {$foo}}}",
46    "params": { "foo": "foo" },
47    "exp": "bar bar"
48  },
49  {
50    "src": ".local $foo = {$bar} {{bar {$foo}}}",
51    "params": { "bar": "foo" },
52    "exp": "bar foo"
53  },
54  {
55    "src": ".local $foo = {$baz} .local $bar = {$foo} {{bar {$bar}}}",
56    "params": { "baz": "foo" },
57    "exp": "bar foo"
58  },
59  {
60    "src": ".input {$foo} {{bar {$foo}}}",
61    "params": { "foo": "foo" },
62    "exp": "bar foo"
63  },
64  {
65    "src": ".input {$foo} .local $bar = {$foo} {{bar {$bar}}}",
66    "params": { "foo": "foo" },
67    "exp": "bar foo"
68  },
69  {
70    "src": ".local $foo = {$baz} .local $bar = {$foo} {{bar {$bar}}}",
71    "params": { "baz": "foo" },
72    "exp": "bar foo"
73  },
74  { "src": ".local $x = {42} .local $y = {$x} {{{$x} {$y}}}", "exp": "42 42" },
75  {
76    "src": "{#tag}",
77    "exp": "",
78    "parts": [{ "type": "markup", "kind": "open", "name": "tag" }]
79  },
80  {
81    "src": "{#tag}content",
82    "exp": "content",
83    "parts": [
84      { "type": "markup", "kind": "open", "name": "tag" },
85      { "type": "literal", "value": "content" }
86    ]
87  },
88  {
89    "src": "{#ns:tag}content{/ns:tag}",
90    "exp": "content",
91    "parts": [
92      { "type": "markup", "kind": "open", "name": "ns:tag" },
93      { "type": "literal", "value": "content" },
94      { "type": "markup", "kind": "close", "name": "ns:tag" }
95    ]
96  },
97  {
98    "src": "{/tag}content",
99    "exp": "content",
100    "parts": [
101      { "type": "markup", "kind": "close", "name": "tag" },
102      { "type": "literal", "value": "content" }
103    ]
104  },
105  {
106    "src": "{#tag foo=bar}",
107    "exp": "",
108    "parts": [
109      {
110        "type": "markup",
111        "kind": "open",
112        "name": "tag",
113        "options": { "foo": "bar" }
114      }
115    ]
116  },
117  {
118    "src": "{#tag foo=bar/}",
119    "cleanSrc": "{#tag foo=bar /}",
120    "exp": "",
121    "parts": [
122      {
123        "type": "markup",
124        "kind": "standalone",
125        "name": "tag",
126        "options": { "foo": "bar" }
127      }
128    ]
129  },
130  {
131    "src": "{#tag a:foo=|foo| b:bar=$bar}",
132    "params": { "bar": "b a r" },
133    "exp": "",
134    "parts": [
135      {
136        "type": "markup",
137        "kind": "open",
138        "name": "tag",
139        "options": { "a:foo": "foo", "b:bar": "b a r" }
140      }
141    ]
142  },
143  {
144    "src": "{/tag foo=bar}",
145    "exp": "",
146    "parts": [
147      {
148        "type": "markup",
149        "kind": "close",
150        "name": "tag",
151        "options": { "foo": "bar" }
152      }
153    ]
154  },
155  {
156    "src": "{42 @foo @bar=13}",
157    "exp": "42",
158    "parts": [{ "type": "string", "value": "42" }]
159  },
160  {
161    "src": "{42 @foo=$bar}",
162    "exp": "42",
163    "parts": [{ "type": "string", "value": "42" }]
164  },
165  {
166    "src": "foo {+reserved}",
167    "exp": "foo {+}",
168    "parts": [
169      { "type": "literal", "value": "foo " },
170      { "type": "fallback", "source": "+" }
171    ],
172    "errorsJs": [{ "type": "unsupported-annotation" }]
173  },
174  {
175    "src": "foo {&private}",
176    "exp": "foo {&}",
177    "parts": [
178      { "type": "literal", "value": "foo " },
179      { "type": "fallback", "source": "&" }
180    ],
181    "errorsJs": [{ "type": "unsupported-annotation" }]
182  },
183  {
184    "src": "foo {?reserved @a @b=$c}",
185    "exp": "foo {?}",
186    "parts": [
187      { "type": "literal", "value": "foo " },
188      { "type": "fallback", "source": "?" }
189    ],
190    "errorsJs": [{ "type": "unsupported-annotation" }]
191  },
192  {
193    "src": ".foo {42} {{bar}}",
194    "exp": "bar",
195    "parts": [{ "type": "literal", "value": "bar" }],
196    "errorsJs": [{ "type": "unsupported-statement" }]
197  },
198  {
199    "src": ".foo{42}{{bar}}",
200    "cleanSrc": ".foo {42} {{bar}}",
201    "exp": "bar",
202    "parts": [{ "type": "literal", "value": "bar" }],
203    "errorsJs": [{ "type": "unsupported-statement" }]
204  },
205  {
206    "src": ".foo |}lit{| {42}{{bar}}",
207    "cleanSrc": ".foo |}lit{| {42} {{bar}}",
208    "exp": "bar",
209    "parts": [{ "type": "literal", "value": "bar" }],
210    "errorsJs": [{ "type": "unsupported-statement" }]
211  }
212]
213