Skip to content

Commit 89e351b

Browse files
committed
Uplift more complete reference test fixtures.
This loops back to projectfluent/fluent#286.
1 parent 7c52588 commit 89e351b

19 files changed

+345
-9
lines changed

fluent-bundle/test/fixtures_reference/messages.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@
4242
"attr1": "Attribute 1"
4343
}
4444
},
45+
{
46+
"id": "no-whitespace",
47+
"value": "Value",
48+
"attributes": {
49+
"attr1": "Attribute 1"
50+
}
51+
},
52+
{
53+
"id": "extra-whitespace",
54+
"value": "Value",
55+
"attributes": {
56+
"attr1": "Attribute 1"
57+
}
58+
},
4559
{
4660
"id": "key06",
4761
"value": [

fluent-bundle/test/fixtures_reference/select_expressions.json

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"attributes": {}
124124
},
125125
{
126-
"id": "invalid-selector-select-expression",
126+
"id": "invalid-selector-nested-expression",
127127
"value": [
128128
{
129129
"type": "select",
@@ -147,7 +147,7 @@
147147
"attributes": {}
148148
},
149149
{
150-
"id": "invalid-selector-nested-expression",
150+
"id": "invalid-selector-select-expression",
151151
"value": [
152152
{
153153
"type": "select",
@@ -210,6 +210,35 @@
210210
],
211211
"attributes": {}
212212
},
213+
{
214+
"id": "reduced-whitespace",
215+
"value": [
216+
{
217+
"type": "select",
218+
"selector": {
219+
"type": "func",
220+
"name": "FOO",
221+
"args": []
222+
},
223+
"variants": [
224+
{
225+
"key": {
226+
"type": "str",
227+
"value": "key"
228+
},
229+
"value": [
230+
{
231+
"type": "str",
232+
"value": ""
233+
}
234+
]
235+
}
236+
],
237+
"star": 0
238+
}
239+
],
240+
"attributes": {}
241+
},
213242
{
214243
"id": "nested-select",
215244
"value": [

fluent-bundle/test/fixtures_reference/select_indent.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@
8585
"value": "key"
8686
},
8787
"value": "Value"
88+
},
89+
{
90+
"key": {
91+
"type": "str",
92+
"value": "other"
93+
},
94+
"value": "Other"
8895
}
8996
],
9097
"star": 0

fluent-bundle/test/fixtures_reference/terms.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@
3030
"attributes": {
3131
"attr1": "Attribute 1"
3232
}
33+
},
34+
{
35+
"id": "-term08",
36+
"value": "Value",
37+
"attributes": {
38+
"attr": "Attribute"
39+
}
40+
},
41+
{
42+
"id": "-term09",
43+
"value": "Value",
44+
"attributes": {
45+
"attr": "Attribute"
46+
}
3347
}
3448
]
3549
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"body": []
3+
}

fluent-syntax/test/fixtures_reference/comments.ftl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ foo = Foo
99
-term = Term
1010
1111
# Another standalone
12-
#
12+
#
1313
# with indent
1414
## Group Comment
1515
### Resource Comment
16+
17+
# Errors
18+
#error
19+
##error
20+
###error

fluent-syntax/test/fixtures_reference/comments.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,25 @@
5858
{
5959
"type": "ResourceComment",
6060
"content": "Resource Comment"
61+
},
62+
{
63+
"type": "Comment",
64+
"content": "Errors"
65+
},
66+
{
67+
"type": "Junk",
68+
"annotations": [],
69+
"content": "#error\n"
70+
},
71+
{
72+
"type": "Junk",
73+
"annotations": [],
74+
"content": "##error\n"
75+
},
76+
{
77+
"type": "Junk",
78+
"annotations": [],
79+
"content": "###error\n"
6180
}
6281
]
6382
}

fluent-syntax/test/fixtures_reference/escaped_characters.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ backslash-in-string = {"\\"}
1212
mismatched-quote = {"\\""}
1313
# ERROR Unknown escape
1414
unknown-escape = {"\x"}
15+
# ERROR Multiline literal
16+
invalid-multiline-literal = {"
17+
"}
1518
1619
## Unicode escapes
1720
string-unicode-4digits = {"\u0041"}

fluent-syntax/test/fixtures_reference/escaped_characters.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,16 @@
168168
{
169169
"type": "Junk",
170170
"annotations": [],
171-
"content": "unknown-escape = {\"\\x\"}\n\n"
171+
"content": "unknown-escape = {\"\\x\"}\n"
172+
},
173+
{
174+
"type": "Comment",
175+
"content": "ERROR Multiline literal"
176+
},
177+
{
178+
"type": "Junk",
179+
"annotations": [],
180+
"content": "invalid-multiline-literal = {\"\n \"}\n\n"
172181
},
173182
{
174183
"type": "GroupComment",

fluent-syntax/test/fixtures_reference/messages.ftl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ key04 =
1818
key05 =
1919
.attr1 = Attribute 1
2020
21+
no-whitespace=Value
22+
.attr1=Attribute 1
23+
24+
extra-whitespace = Value
25+
.attr1 = Attribute 1
26+
2127
key06 = {""}
2228
2329
# JUNK Missing value

0 commit comments

Comments
 (0)