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

39 lines
841 B
Python

#coding:utf-8
"""
ID: issue-4442
ISSUE: 4442
TITLE: SIMILAR TO does not work with x-prefixed literals
DESCRIPTION:
JIRA: CORE-4114
"""
import pytest
from firebird.qa import *
db = db_factory()
test_script = """
set list on;
select
iif(' ' similar to '[[:WHITESPACE:]]', 'T', 'F') as f1,
iif(_win1252 x'20' similar to '[[:WHITESPACE:]]', 'T', 'F') as f2,
iif(_win1252 x'20' similar to '%', 'T', 'F') as f3
from RDB$DATABASE ;
"""
act = isql_act('db', test_script)
expected_stdout = """
F1 T
F2 T
F3 T
"""
@pytest.mark.version('>=3.0')
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout