From 7b02e1a4da3e3b97e088b3b27d71149c27ff82c1 Mon Sep 17 00:00:00 2001 From: "Akshay\" (aider)" Date: Sun, 13 Oct 2024 12:43:09 +0530 Subject: test: add test for the `parent` node builtin --- src/eval/test.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 @@ -357,6 +357,26 @@ fn string_4() { ); } +#[test] +fn node_1() { + gen_test( + "def foo(a, b): hello()", + r#"enter function_definition { + println(text(node)); + println(text(node.name)); + }"#, + "def foo(a, b): hello()", + r#"enter function_definition { + node n = node; + println(text(parent(n))); + }"#, + expect![[r#" + def foo(a, b): hello() + "#]], + expect![], + ); +} + #[test] fn node_1() { gen_test( -- cgit v1.2.3