mirror of
https://github.com/FirebirdSQL/firebird-qa.git
synced 2025-01-22 21:43:06 +01:00
Added/Updated tests\bugs\core_1366_test.py: Re-implemented. See notes. Checked on 6.0.0.511 (Windows/Linux); 5.0.2.1550; 4.0.6.3165; 3.0.2.32670, 3,0,1,32609
This commit is contained in:
parent
b64fc14d0e
commit
ba89f2888e
@ -4,19 +4,29 @@
|
|||||||
ID: issue-1784
|
ID: issue-1784
|
||||||
ISSUE: 1784
|
ISSUE: 1784
|
||||||
TITLE: French insensitive collation FR_FR_CI_AI
|
TITLE: French insensitive collation FR_FR_CI_AI
|
||||||
DESCRIPTION:
|
DESCRIPTION: Add French case-/accent-insensitive collation.
|
||||||
JIRA: CORE-1366
|
JIRA: CORE-1366
|
||||||
FBTEST: bugs.core_1366
|
FBTEST: bugs.core_1366
|
||||||
NOTES:
|
NOTES:
|
||||||
[06.10.2022] pzotov
|
[31.10.2024] pzotov
|
||||||
Could not complete adjusting for LINUX in new-qa.
|
Bug was fixed for too old FB (2.1.8), firebird-driver and/or QA-plugin
|
||||||
DEFERRED.
|
will not able to run on this version in order to reproduce problem.
|
||||||
|
|
||||||
|
Checked on 6.0.0.511 (Windows/Linux); 5.0.2.1550; 4.0.6.3165; 3.0.2.32670, 3,0,1,32609
|
||||||
"""
|
"""
|
||||||
import platform
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from firebird.qa import *
|
from firebird.qa import *
|
||||||
|
|
||||||
init_script = """
|
db = db_factory(charset='ISO8859_1')
|
||||||
|
act = isql_act('db', substitutions=[('=.*', ''), ('[ \\t]+', ' ')])
|
||||||
|
tmp_sql = temp_file('tmp_core_1366.sql')
|
||||||
|
|
||||||
|
@pytest.mark.version('>=3.0.0')
|
||||||
|
def test_1(act: Action, tmp_sql: Path):
|
||||||
|
|
||||||
|
test_script = f"""
|
||||||
recreate table test(id int);
|
recreate table test(id int);
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
@ -39,10 +49,6 @@ init_script = """
|
|||||||
|
|
||||||
-- http://french.about.com/od/pronunciation/a/accents.htm
|
-- http://french.about.com/od/pronunciation/a/accents.htm
|
||||||
|
|
||||||
-- ### ONCE AGAIN ###
|
|
||||||
-- 1) for checking this under ISQL following must be encoded in ISO8859_1
|
|
||||||
-- 2) for running under fbt_run utility following must be encoded in UTF8.
|
|
||||||
|
|
||||||
-- (cedilla) is found only on the letter "C":
|
-- (cedilla) is found only on the letter "C":
|
||||||
insert into test(id, cf) values( 1010, 'ç');
|
insert into test(id, cf) values( 1010, 'ç');
|
||||||
|
|
||||||
@ -76,21 +82,18 @@ init_script = """
|
|||||||
insert into noac(id, nf) values( 1190, 'O');
|
insert into noac(id, nf) values( 1190, 'O');
|
||||||
insert into noac(id, nf) values( 1200, 'U');
|
insert into noac(id, nf) values( 1200, 'U');
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
db = db_factory(charset='ISO8859_1', init=init_script)
|
|
||||||
|
|
||||||
test_script = """
|
|
||||||
select n.id n_id, n.nf, t.cf, t.id t_id
|
select n.id n_id, n.nf, t.cf, t.id t_id
|
||||||
from noac n
|
from noac n
|
||||||
left join test t on n.nf is not distinct from t.cf
|
left join test t on n.nf is not distinct from t.cf
|
||||||
order by n_id, t_id;
|
order by n_id, t_id;
|
||||||
"""
|
"""
|
||||||
|
|
||||||
act = isql_act('db', test_script, substitutions=[('=.*', ''), ('[ \t]+', ' ')])
|
# https://github.com/FirebirdSQL/firebird/issues/1784#issuecomment-826188088
|
||||||
|
# ::: NB :::
|
||||||
expected_stdout = """
|
# For proper output of test, input script must be encoded in ISO8859_1 rather than in UTF-8.
|
||||||
|
#
|
||||||
|
tmp_sql.write_text(test_script, encoding='iso8859_1')
|
||||||
|
act.expected_stdout = """
|
||||||
N_ID NF CF T_ID
|
N_ID NF CF T_ID
|
||||||
============ ========== ========== ============
|
============ ========== ========== ============
|
||||||
1150 A à 1030
|
1150 A à 1030
|
||||||
@ -107,11 +110,5 @@ expected_stdout = """
|
|||||||
1200 U ü 1080
|
1200 U ü 1080
|
||||||
1200 U û 1130
|
1200 U û 1130
|
||||||
"""
|
"""
|
||||||
|
act.isql(switches = ['-q'], input_file = tmp_sql, charset = 'iso8859_1', combine_output = True)
|
||||||
@pytest.mark.skipif(platform.system() != 'Windows', reason='FIXME: see notes')
|
|
||||||
@pytest.mark.version('>=3')
|
|
||||||
def test_1(act: Action):
|
|
||||||
act.expected_stdout = expected_stdout
|
|
||||||
act.execute()
|
|
||||||
assert act.clean_stdout == act.clean_expected_stdout
|
assert act.clean_stdout == act.clean_expected_stdout
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user