def test_nested(): """Assert we identify calls to functions within the calling scope.""" js = """function call() { function answer() {} answer(); }""" ast = parse(js) g = call_graph(ast) eq_(set([(get_name(x), get_name(y)) for x, y in g.edges()]), set([('call', 'answer')]))
def test_nested(): """Assert we identify calls to functions within the calling scope.""" js = """function call() { function answer() {} answer(); }""" ast = parse(js) g = call_graph(ast) eq_(set([(get_name(x), get_name(y)) for x,y in g.edges()]), set([('call', 'answer')]))
def test_simple(): """Assert we notice simple calls to functions stored in global scope.""" js = """function answer() {} function call() { answer(); }""" ast = parse(js) g = call_graph(ast) eq_(set([(get_name(x), get_name(y)) for x, y in g.edges()]), set([('call', 'answer')]))
def test_simple(): """Assert we notice simple calls to functions stored in global scope.""" js = """function answer() {} function call() { answer(); }""" ast = parse(js) g = call_graph(ast) eq_(set([(get_name(x), get_name(y)) for x,y in g.edges()]), set([('call', 'answer')]))