We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae4bf11 commit 646c9deCopy full SHA for 646c9de
test/test_pymbolic.py
@@ -955,6 +955,18 @@ def test_nodecount():
955
assert get_num_nodes(expr) == 12
956
957
958
+def test_python_ast_interop_roundtrip():
959
+ from pymbolic.interop.ast import (ASTToPymbolic,
960
+ PymbolicToASTMapper)
961
+
962
+ ast2p = ASTToPymbolic()
963
+ p2ast = PymbolicToASTMapper()
964
+ ntests = 40
965
+ for i in range(ntests):
966
+ expr = generate_random_expression(seed=(5+i))
967
+ assert ast2p(p2ast(expr)) == expr
968
969
970
if __name__ == "__main__":
971
import sys
972
if len(sys.argv) > 1:
0 commit comments