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

60 lines
1.3 KiB
Python
Raw Normal View History

#coding:utf-8
2022-01-27 20:08:36 +01:00
"""
ID: issue-6903
ISSUE: 6903
TITLE: Unable to create ICU-based collation with locale keywords
DESCRIPTION:
"""
2022-01-27 20:08:36 +01:00
import pytest
from firebird.qa import *
2022-01-27 20:08:36 +01:00
db = db_factory()
2022-01-27 20:08:36 +01:00
test_script = """
-- should PASS:
create collation unicode_txt_01 for utf8 from unicode
pad space
case sensitive
accent sensitive
'LOCALE=de-u-co-phonebk-ka-shifted'
;
-- should PASS:
create collation unicode_txt_02 for utf8 from unicode
'locale=en-u-kr-grek-latn-digit'
;
-- should PASS:
create collation unicode_txt_03 for utf8 from unicode
2022-01-27 20:08:36 +01:00
pad space
case sensitive
accent sensitive
'LOCALE=el@colCaseFirst=upper'
;
-- should FAIL!
-- See: https://github.com/FirebirdSQL/firebird/pull/6914
-- Note by Adriano "I tried ... it worked, but should not"
2022-01-27 20:08:36 +01:00
create collation unicode_bad_01 for utf8 from unicode
'LOCALE=pt_BRx'
;
"""
2022-01-27 20:08:36 +01:00
act = isql_act('db', test_script, substitutions=[('[ \t]+', ' ')])
2022-01-27 20:08:36 +01:00
expected_stderr = """
Statement failed, SQLSTATE = HY000
unsuccessful metadata update
-CREATE COLLATION UNICODE_BAD_01 failed
-Invalid collation attributes
"""
@pytest.mark.version('>=4.0.1')
2022-01-27 20:08:36 +01:00
def test_1(act: Action):
act.expected_stderr = expected_stderr
act.execute()
assert act.clean_stderr == act.clean_expected_stderr