From 927d259fff70813f50440b53c8e913a6f175f3de Mon Sep 17 00:00:00 2001 From: Gaudeval Date: Wed, 6 Jan 2021 14:10:58 +0000 Subject: [PATCH] Add test for missing values in timed until evaluation --- mtl/test_eval.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/mtl/test_eval.py b/mtl/test_eval.py index 09d34fe..3aa6c31 100644 --- a/mtl/test_eval.py +++ b/mtl/test_eval.py @@ -42,3 +42,27 @@ def test_eval_regression_until_start(): phi = (mtl.parse("(X TRUE W X TRUE)")) phi(x, 0, quantitative=False) + + +def test_eval_regression_timed_until(): + """From issue #217""" + x = { + 'start': [(0, True), (200, False)], + 'success': [(0, False), (300, True)] + } + phi = mtl.parse('(~start U[0,120] success)') + assert phi(x, time=200, quantitative=False, dt=1) + + y = { + 'start': [(0, True), (1, False), (5, True), (6, True)], + 'success': [(0, False), (20, True)] + } + phi1 = mtl.parse('(start U[0,20] success)') + assert phi1(y, time=6, quantitative=False, dt=1) + + z = { + 'start': [(0, True), (200, False)], + 'success': [(0, False), (300, True)] + } + phi2 = mtl.parse('F[0,120]success') + assert phi2(z, time=181, quantitative=False, dt=1)