MCPcopy Create free account
hub / github.com/PRQL/prql / test_take

Function test_take

prqlc/prqlc-parser/src/test.rs:158–225  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156
157#[test]
158fn test_take() {
159 parse_source("take 10").unwrap();
160
161 assert_yaml_snapshot!(parse_source(r#"take 10"#).unwrap(), @r#"
162 - VarDef:
163 kind: Main
164 name: main
165 value:
166 FuncCall:
167 name:
168 Ident:
169 - take
170 span: "0:0-4"
171 args:
172 - Literal:
173 Integer: 10
174 span: "0:5-7"
175 span: "0:0-7"
176 span: "0:0-7"
177 "#);
178
179 assert_yaml_snapshot!(parse_source(r#"take ..10"#).unwrap(), @r#"
180 - VarDef:
181 kind: Main
182 name: main
183 value:
184 FuncCall:
185 name:
186 Ident:
187 - take
188 span: "0:0-4"
189 args:
190 - Range:
191 start: ~
192 end:
193 Literal:
194 Integer: 10
195 span: "0:7-9"
196 span: "0:4-9"
197 span: "0:0-9"
198 span: "0:0-9"
199 "#);
200
201 assert_yaml_snapshot!(parse_source(r#"take 1..10"#).unwrap(), @r#"
202 - VarDef:
203 kind: Main
204 name: main
205 value:
206 FuncCall:
207 name:
208 Ident:
209 - take
210 span: "0:0-4"
211 args:
212 - Range:
213 start:
214 Literal:
215 Integer: 1

Callers

nothing calls this directly

Calls 1

parse_sourceFunction · 0.70

Tested by

no test coverage detected