Skip to content

Commit

Permalink
Make the regression test for pg_eucjp stable.
Browse files Browse the repository at this point in the history
Previously, the regression test for the pg_eucjp function output
the EUC_JP characters in the order of the character itself.
However, this order could vary depending on the platform,
causing the test to fail unpredictably.

To address this issue, this commit updates the test so that
it outputs the characters in the order of each character's code instead.
This ensures that the output is consistent across platforms and
guarantees that the test is stable.

No functional changes are made to the pg_eucjp function.
  • Loading branch information
MasaoFujii committed Apr 26, 2023
1 parent 0328555 commit 2ddc4bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion expected/pg_eucjp.out
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ SELECT count(*) FROM all_eucjp
0
(1 row)

SELECT * FROM all_eucjp ORDER BY eucjp;
SELECT * FROM all_eucjp ORDER BY code1, code2, code3;
code1 | code2 | code3 | eucjp
-------+-------+-------+----------
x00 | x00 | x00 |
Expand Down
2 changes: 1 addition & 1 deletion sql/pg_eucjp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CREATE TABLE all_eucjp(code1 text, code2 text, code3 text, eucjp text);
INSERT INTO all_eucjp SELECT * FROM pg_all_eucjp();
SELECT count(*) FROM all_eucjp
WHERE pg_eucjp(code1::bit(8), code2::bit(8), code3::bit(8)) <> eucjp;
SELECT * FROM all_eucjp ORDER BY eucjp;
SELECT * FROM all_eucjp ORDER BY code1, code2, code3;

SELECT pg_eucjp('xb6', 'xe5') || pg_eucjp('xfc', 'xf9') || pg_eucjp('xad', 'xa9') || pg_eucjp('xfa', 'xdb');

Expand Down

0 comments on commit 2ddc4bb

Please sign in to comment.