From dab08cb589913c3f8e4ccb07acdaf9b70f538cad Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Mon, 20 Jun 2022 18:08:28 +0800 Subject: [PATCH] test: add test case for TS-1601 --- tests/pytest/functions/function_first.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/pytest/functions/function_first.py b/tests/pytest/functions/function_first.py index c1f7692dfd..6c3a747feb 100644 --- a/tests/pytest/functions/function_first.py +++ b/tests/pytest/functions/function_first.py @@ -17,6 +17,7 @@ from util.log import * from util.cases import * from util.sql import * import numpy as np +import re class TDTestCase: @@ -152,7 +153,7 @@ class TDTestCase: r = os.popen("taos -s 'select first(c1) + last(c1) from test.tb01'") text = r.read() r.close() - result = float(text.split("|")[1].split("\n")[2]) + result = float(re.split('\n |\|', text)[3]) tdSql.query("select first(c1) + last(c1) from tb01") tdSql.checkData(0, 0, result) @@ -160,8 +161,8 @@ class TDTestCase: r = os.popen("taos -s 'select first(c1) - last(c1) from test.tb01'") text = r.read() r.close() - result = float(text.split("|")[1].split("\n")[2]) - tdSql.query("select first(c1) - last(c1) from tb01") + result = float(re.split('\n |\|', text)[3]) + tdSql.query("select first(c1) + last(c1) from tb01") tdSql.checkData(0, 0, result) -- GitLab