implement smoketest robustness checks

This commit is contained in:
Marcell Vazquez-Chanlatte 2016-10-09 19:48:26 -07:00
parent fb617482bf
commit 42efc69556
3 changed files with 27 additions and 14 deletions

View file

@ -1,16 +1,9 @@
# -*- coding: utf-8 -*-
import stl
from blustl.game import from_yaml
from nose2.tools import params
import unittest
from sympy import Symbol
from glob import glob
def main():
with open('examples/example1.stl', 'r') as f:
print(from_yaml(f))
ex1 = ('x1 > 2', stl.LinEq(
(stl.Var(1, Symbol("x1"), stl.ast.t_sym),),
">",
@ -23,12 +16,7 @@ ex3 = ('□[2,3]◇[0,1](x1 > 2)', stl.G(i2, ex2[1]))
ex4 = ('(x1 > 2) or ((x1 > 2) or (x1 > 2))',
stl.Or((ex1[1], ex1[1], ex1[1])))
example_ymls = glob('examples/*')
class TestSTLParser(unittest.TestCase):
@params(ex1, ex2, ex3, ex4)
def test_stl(self, phi_str, phi):
self.assertEqual(stl.parse(phi_str), phi)