mtl-aas/mtl/test_parser.py
2018-09-06 11:09:01 -07:00

22 lines
478 B
Python

# -*- coding: utf-8 -*-
from hypothesis import event, given
import mtl
from mtl.hypothesis import MetricTemporalLogicStrategy
@given(MetricTemporalLogicStrategy)
def test_invertable_repr(phi):
event(str(phi))
assert str(phi) == str(mtl.parse(str(phi)))
@given(MetricTemporalLogicStrategy)
def test_hash_inheritance(phi):
assert hash(repr(phi)) == hash(phi)
def test_sugar_smoke():
mtl.parse('(x <-> x)')
mtl.parse('(x -> x)')
mtl.parse('(x ^ x)')