コード例 #1
0
ファイル: test_core.py プロジェクト: jaberg/logpy
def test_goaleval():
    x, y = var("x"), var("y")
    g = eq(x, 2)
    assert goaleval(g) == g
    assert callable(goaleval((eq, x, 2)))
    raises(EarlyGoalError, lambda: goaleval((membero, x, y)))
    assert callable(goaleval((lall, (eq, x, 2))))
コード例 #2
0
def test_goaleval():
    x, y = var('x'), var('y')
    g = eq(x, 2)
    assert goaleval(g) == g
    assert callable(goaleval((eq, x, 2)))
    raises(EarlyGoalError, lambda: goaleval((membero, x, y)))
    assert callable(goaleval((lall, (eq, x, 2))))
コード例 #3
0
ファイル: test_util.py プロジェクト: cherry-wb/logpy
def test_raises():
    raises(ZeroDivisionError, lambda: 1/0)
コード例 #4
0
ファイル: test_goals.py プロジェクト: alexrudnick/logpy
def test_heado():
    x, y = var('x'), var('y')
    assert results(heado(x, (1,2,3))) == ({x: 1},)
    assert results(heado(1, (x,2,3))) == ({x: 1},)
    raises(EarlyGoalError, lambda: heado(x, y))
コード例 #5
0
ファイル: test_goals.py プロジェクト: alexrudnick/logpy
def test_tailo():
    x, y = var('x'), var('y')
    assert results((tailo, x, (1,2,3))) == ({x: (2,3)},)
    raises(EarlyGoalError, lambda: tailo(x, y))
コード例 #6
0
ファイル: test_core.py プロジェクト: PhoenixBureau/logpy
def test_tailo():
    x, y = var('x'), var('y')
    assert tuple(tailo(x, (1,2,3))({})) == ({x: (2,3)},)
    raises(EarlyGoalError, lambda: tailo(x, y))
コード例 #7
0
ファイル: test_goals.py プロジェクト: sarvex/logpy
def test_tailo():
    x, y = var('x'), var('y')
    assert results((tailo, x, (1, 2, 3))) == ({x: (2, 3)}, )
    raises(EarlyGoalError, lambda: tailo(x, y))
コード例 #8
0
ファイル: test_goals.py プロジェクト: sarvex/logpy
def test_heado():
    x, y = var('x'), var('y')
    assert results(heado(x, (1, 2, 3))) == ({x: 1}, )
    assert results(heado(1, (x, 2, 3))) == ({x: 1}, )
    raises(EarlyGoalError, lambda: heado(x, y))
コード例 #9
0
def test_raises():
    raises(ZeroDivisionError, lambda: 1/0)