6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 21:43:06 +01:00
firebird-qa/tests/functional/domain/create/test_54.py

47 lines
1.2 KiB
Python
Raw Normal View History

2021-04-26 20:07:00 +02:00
#coding:utf-8
"""
2022-02-04 19:05:19 +01:00
ID: domain.create-43
FBTEST: functional.domain.create.54
ISSUE: 1026
JIRA: CORE-660
TITLE: Use of domains for Trigger/SP variable definition
DESCRIPTION:
Allow domains to be applied to variables and in/out parameters within a trigger or SP
"""
import pytest
from firebird.qa import *
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
db = db_factory(init="create domain d as integer;")
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
test_script = """set term !!;
2021-04-26 20:07:00 +02:00
create procedure sp (i type of d) returns (o type of d)
as
declare variable v type of d;
begin
v = cast(v as type of d);
end!!
commit!!
set term ;!!
show procedure sp;"""
2022-02-04 19:05:19 +01:00
act = isql_act('db', test_script)
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
expected_stdout = """Procedure text:
2021-04-26 20:07:00 +02:00
=============================================================================
declare variable v type of d;
begin
v = cast(v as type of d);
end
=============================================================================
Parameters:
I INPUT (TYPE OF D) INTEGER
O OUTPUT (TYPE OF D) INTEGER"""
2021-04-26 20:07:00 +02:00
2022-02-04 19:05:19 +01:00
@pytest.mark.version('>=3')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout