File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed
Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -107,22 +107,22 @@ def test_dynfors_loop():
107107 assert str (pathes [0 ]) == "PLpgSQL_stmt_raise(6) -> PLpgSQL_stmt_return()"
108108
109109
110- # def test_forc_loop():
111- # sql = """
112- # CREATE FUNCTION foo(cmd TEXT) RETURNS void AS $$
113- # DECLARE
114- # i INT;
115- # c CURSOR FOR SELECT generate_series(1,10);
116- # BEGIN
117- # FOR i IN c LOOP
118- # RAISE NOTICE 'i is %',i;
119- # END LOOP;
120- # END
121- # $$ LANGUAGE plpgsql;
122- # """
123- # parsed = parse_plpgsql(sql)
124- # node = build_node(parsed[0])
125- # pathes = list(paths(node))
126- # assert len(pathes) == 1
127- #
128- # assert str(pathes[0]) == "PLpgSQL_stmt_raise(6 ) -> PLpgSQL_stmt_return()"
110+ def test_forc_loop ():
111+ sql = """
112+ CREATE FUNCTION foo(cmd TEXT) RETURNS void AS $$
113+ DECLARE
114+ i INT;
115+ c CURSOR FOR SELECT generate_series(1,10);
116+ BEGIN
117+ FOR i IN c LOOP
118+ RAISE NOTICE 'i is %',i;
119+ END LOOP;
120+ END
121+ $$ LANGUAGE plpgsql;
122+ """
123+ parsed = parse_plpgsql (sql )
124+ node = build_node (parsed [0 ])
125+ pathes = list (paths (node ))
126+ assert len (pathes ) == 1
127+
128+ assert str (pathes [0 ]) == "PLpgSQL_stmt_raise(7 ) -> PLpgSQL_stmt_return()"
You can’t perform that action at this time.
0 commit comments