mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 13:33:07 +01:00
Added/Updated tests\bugs\core_4280_test.py: Expected error message become differ in FB 6.x, added splitting.
This commit is contained in:
parent
e95286d49f
commit
9500ed44e4
@ -15,48 +15,36 @@ from firebird.qa import *
|
||||
db = db_factory()
|
||||
|
||||
test_script = """
|
||||
create view v_check as
|
||||
select
|
||||
rf.rdb$function_name as func_name
|
||||
,rf.rdb$legacy_flag as legacy_flag
|
||||
from rdb$functions rf where rf.rdb$function_name = upper('psql_func_test')
|
||||
;
|
||||
commit;
|
||||
|
||||
set term ^;
|
||||
create function psql_func_test(x integer, y boolean, x integer) -- argument `x` appears twice
|
||||
create function psql_func_test(a_x integer, a_y boolean, a_x integer) -- argument `a_x` appears twice
|
||||
returns integer as
|
||||
begin
|
||||
return x + 1;
|
||||
return a_x + 1;
|
||||
end
|
||||
^
|
||||
set term ;^
|
||||
commit;
|
||||
|
||||
set list on;
|
||||
set count on;
|
||||
select * from v_check;
|
||||
|
||||
"""
|
||||
|
||||
act = isql_act('db', test_script)
|
||||
|
||||
expected_stdout = """
|
||||
Records affected: 0
|
||||
"""
|
||||
|
||||
expected_stderr = """
|
||||
expected_stdout_5x = """
|
||||
Statement failed, SQLSTATE = 42000
|
||||
CREATE FUNCTION PSQL_FUNC_TEST failed
|
||||
-SQL error code = -901
|
||||
-duplicate specification of X - not supported
|
||||
-duplicate specification of A_X - not supported
|
||||
"""
|
||||
|
||||
expected_stdout_6x = """
|
||||
Statement failed, SQLSTATE = 42000
|
||||
CREATE FUNCTION PSQL_FUNC_TEST failed
|
||||
-Dynamic SQL Error
|
||||
-SQL error code = -637
|
||||
-duplicate specification of A_X - not supported
|
||||
"""
|
||||
|
||||
@pytest.mark.version('>=3.0')
|
||||
def test_1(act: Action):
|
||||
act.expected_stdout = expected_stdout
|
||||
act.expected_stderr = expected_stderr
|
||||
act.execute()
|
||||
assert (act.clean_stderr == act.clean_expected_stderr and
|
||||
act.clean_stdout == act.clean_expected_stdout)
|
||||
|
||||
act.expected_stdout = expected_stdout_5x if act.is_version('<6') else expected_stdout_6x
|
||||
act.execute(combine_output = True)
|
||||
assert act.clean_stdout == act.clean_expected_stdout
|
||||
|
Loading…
Reference in New Issue
Block a user