Debian Codegraph @

tests/testthat/_snaps/render.md

raw symbols SCIP
1 # include tag
2
3 Code
4 render(fs::path("templates/foo"), name = "world", .config = jinjar_config(
5 ignore_missing_files = TRUE))
6 Output
7 [1] "Welcome: "
8
9 ---
10
11 Code
12 render(fs::path("foo"), name = "world", .config = jinjar_config(path_loader(fs::path_wd(
13 "templates"))))
14 Output
15 [1] "Welcome: Hello world!\n"
16
17 ---
18
19 Code
20 render(src, name = "world", .config = list_config)
21 Output
22 [1] "Welcome: Hello world!"
23
24 # extends tag
25
26 Code
27 render(fs::path("foo"), name = "world", .config = jinjar_config(
28 ignore_missing_files = TRUE))
29 Output
30 [1] "world"
31
32 ---
33
34 Code
35 render(fs::path("foo"), name = "world", .config = jinjar_config(path_loader(fs::path_wd())))
36 Output
37 [1] "Hello world!\n"
38
39 ---
40
41 Code
42 render(src, name = "world", .config = list_config)
43 Output
44 [1] "Hello world!"
45
46 # render error [plain]
47
48 Code
49 render("Hello {{ name }}!")
50 Condition
51 Error in `render()`:
52 ! Problem encountered while rendering template.
53 Caused by error:
54 ! Variable 'name' not found.
55 i Error occurred on line 1 and column 10.
56
57 ---
58
59 Code
60 render("{% include \"missing.html\" %}")
61 Condition
62 Error in `render()`:
63 ! Problem encountered while rendering template.
64 Caused by error:
65 ! Include 'missing.html' not found.
66 i Error occurred on line 1 and column 12.
67
68 ---
69
70 Code
71 render("{% for x in vec %}{{ x }}{% endfor %}", vec = "world")
72 Condition
73 Error in `render()`:
74 ! Problem encountered while rendering template.
75 Caused by error:
76 ! Object must be an array.
77 i Have you forgotten to wrap a length-1 vector with I()?
78 i Error occurred on line 1 and column 10.
79
80 # render error [ansi]
81
82 Code
83 render("Hello {{ name }}!")
84 Condition
85 Error in `render()`:
86 ! Problem encountered while rendering template.
87 Caused by error:
88 ! Variable 'name' not found.
89 i Error occurred on line 1 and column 10.
90
91 ---
92
93 Code
94 render("{% include \"missing.html\" %}")
95 Condition
96 Error in `render()`:
97 ! Problem encountered while rendering template.
98 Caused by error:
99 ! Include 'missing.html' not found.
100 i Error occurred on line 1 and column 12.
101
102 ---
103
104 Code
105 render("{% for x in vec %}{{ x }}{% endfor %}", vec = "world")
106 Condition
107 Error in `render()`:
108 ! Problem encountered while rendering template.
109 Caused by error:
110 ! Object must be an array.
111 i Have you forgotten to wrap a length-1 vector with I()?
112 i Error occurred on line 1 and column 10.
113
114 # render error [unicode]
115
116 Code
117 render("Hello {{ name }}!")
118 Condition
119 Error in `render()`:
120 ! Problem encountered while rendering template.
121 Caused by error:
122 ! Variable 'name' not found.
123 ℹ Error occurred on line 1 and column 10.
124
125 ---
126
127 Code
128 render("{% include \"missing.html\" %}")
129 Condition
130 Error in `render()`:
131 ! Problem encountered while rendering template.
132 Caused by error:
133 ! Include 'missing.html' not found.
134 ℹ Error occurred on line 1 and column 12.
135
136 ---
137
138 Code
139 render("{% for x in vec %}{{ x }}{% endfor %}", vec = "world")
140 Condition
141 Error in `render()`:
142 ! Problem encountered while rendering template.
143 Caused by error:
144 ! Object must be an array.
145 ℹ Have you forgotten to wrap a length-1 vector with I()?
146 ℹ Error occurred on line 1 and column 10.
147
148 # render error [fancy]
149
150 Code
151 render("Hello {{ name }}!")
152 Condition
153 Error in `render()`:
154 ! Problem encountered while rendering template.
155 Caused by error:
156 ! Variable 'name' not found.
157 ℹ Error occurred on line 1 and column 10.
158
159 ---
160
161 Code
162 render("{% include \"missing.html\" %}")
163 Condition
164 Error in `render()`:
165 ! Problem encountered while rendering template.
166 Caused by error:
167 ! Include 'missing.html' not found.
168 ℹ Error occurred on line 1 and column 12.
169
170 ---
171
172 Code
173 render("{% for x in vec %}{{ x }}{% endfor %}", vec = "world")
174 Condition
175 Error in `render()`:
176 ! Problem encountered while rendering template.
177 Caused by error:
178 ! Object must be an array.
179 ℹ Have you forgotten to wrap a length-1 vector with I()?
180 ℹ Error occurred on line 1 and column 10.
181
182 # JSON encoding error [plain]
183
184 Code
185 jinjar:::with_catch_cpp_errors({
186 jinjar:::render_(attr(x, "parsed"), "{\"name\": \"world\"]}")
187 })
188 Condition
189 Error:
190 ! Problem encountered while decoding JSON data.
191 i This is an internal error that was detected in the jinjar package.
192 Please report it at <https://github.com/davidchall/jinjar/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
193 Caused by error:
194 ! [json.exception.parse_error.101] parse error at line 1, column 17: syntax error while parsing object - unexpected ']'; expected '}'
195 i JSON object: "{\"name\": \"world\"]}"
196
197 # JSON encoding error [ansi]
198
199 Code
200 jinjar:::with_catch_cpp_errors({
201 jinjar:::render_(attr(x, "parsed"), "{\"name\": \"world\"]}")
202 })
203 Condition
204 Error:
205 ! Problem encountered while decoding JSON data.
206 i This is an internal error that was detected in the jinjar package.
207 Please report it at <https://github.com/davidchall/jinjar/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
208 Caused by error:
209 ! [json.exception.parse_error.101] parse error at line 1, column 17: syntax error while parsing object - unexpected ']'; expected '}'
210 i JSON object: "{\"name\": \"world\"]}"
211
212 # JSON encoding error [unicode]
213
214 Code
215 jinjar:::with_catch_cpp_errors({
216 jinjar:::render_(attr(x, "parsed"), "{\"name\": \"world\"]}")
217 })
218 Condition
219 Error:
220 ! Problem encountered while decoding JSON data.
221 ℹ This is an internal error that was detected in the jinjar package.
222 Please report it at <https://github.com/davidchall/jinjar/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
223 Caused by error:
224 ! [json.exception.parse_error.101] parse error at line 1, column 17: syntax error while parsing object - unexpected ']'; expected '}'
225 ℹ JSON object: "{\"name\": \"world\"]}"
226
227 # JSON encoding error [fancy]
228
229 Code
230 jinjar:::with_catch_cpp_errors({
231 jinjar:::render_(attr(x, "parsed"), "{\"name\": \"world\"]}")
232 })
233 Condition
234 Error:
235 ! Problem encountered while decoding JSON data.
236 ℹ This is an internal error that was detected in the jinjar package.
237 Please report it at <https://github.com/davidchall/jinjar/issues> with a reprex (<https://tidyverse.org/help/>) and the full backtrace.
238 Caused by error:
239 ! [json.exception.parse_error.101] parse error at line 1, column 17: syntax error while parsing object - unexpected ']'; expected '}'
240 ℹ JSON object: "{\"name\": \"world\"]}"
241