Revise ast package

add test