6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-23 14:03:06 +01:00
firebird-qa/tests/bugs/core_1453_test.py

57 lines
1.4 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
2022-01-20 17:32:14 +01:00
"""
ID: issue-1871
ISSUE: 1871
TITLE: Allow usage of functions in LIST delimiter parameter
DESCRIPTION:
JIRA: CORE-1443
FBTEST: bugs.core_1453
2022-01-20 17:32:14 +01:00
"""
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
init_script = """CREATE TABLE T1 (ID INTEGER, NAME CHAR(20));
2021-04-26 20:07:00 +02:00
COMMIT;
INSERT INTO T1 (ID,NAME) VALUES (1,'ORANGE');
INSERT INTO T1 (ID,NAME) VALUES (1,'APPLE');
INSERT INTO T1 (ID,NAME) VALUES (1,'LEMON');
INSERT INTO T1 (ID,NAME) VALUES (2,'ORANGE');
INSERT INTO T1 (ID,NAME) VALUES (2,'APPLE');
INSERT INTO T1 (ID,NAME) VALUES (2,'PEAR');
COMMIT;
"""
2022-01-20 17:32:14 +01:00
db = db_factory(init=init_script)
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
test_script = """select ID, LIST( trim(NAME), ASCII_CHAR(35) )
2021-04-26 20:07:00 +02:00
from T1
group by 1;
"""
2022-01-20 17:32:14 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-01-20 17:32:14 +01:00
expected_stdout = """
2021-04-26 20:07:00 +02:00
ID LIST
============ =================
1 0:1
==============================================================================
LIST:
ORANGE#LEMON#APPLE
==============================================================================
2 0:2
==============================================================================
LIST:
PEAR#ORANGE#APPLE
==============================================================================
2022-01-20 17:32:14 +01:00
"""
2021-04-26 20:07:00 +02:00
@pytest.mark.version('>=2.5.0')
2022-01-20 17:32:14 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout
2021-04-26 20:07:00 +02:00