aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkshay" (aider) <[email protected]>2024-10-13 08:13:09 +0100
committerAkshay" (aider) <[email protected]>2024-10-13 08:13:09 +0100
commit7b02e1a4da3e3b97e088b3b27d71149c27ff82c1 (patch)
treeab04403894a91beb244452e23524f46d4fda8d0c /src
parentbdbb1b33fdac8491bc9a517be3807d97e17d69c9 (diff)
test: add test for the `parent` node builtinHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/eval/test.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/eval/test.rs b/src/eval/test.rs
index c9e7630..5fc385d 100644
--- a/src/eval/test.rs
+++ b/src/eval/test.rs
@@ -365,6 +365,26 @@ fn node_1() {
365 println(text(node)); 365 println(text(node));
366 println(text(node.name)); 366 println(text(node.name));
367 }"#, 367 }"#,
368 "def foo(a, b): hello()",
369 r#"enter function_definition {
370 node n = node;
371 println(text(parent(n)));
372 }"#,
373 expect![[r#"
374 def foo(a, b): hello()
375 "#]],
376 expect![],
377 );
378}
379
380#[test]
381fn node_1() {
382 gen_test(
383 "def foo(a, b): hello()",
384 r#"enter function_definition {
385 println(text(node));
386 println(text(node.name));
387 }"#,
368 expect![[r#" 388 expect![[r#"
369 def foo(a, b): hello() 389 def foo(a, b): hello()
370 foo 390 foo