Skip to content

Commit d09ee65

Browse files
committed
Align testHexadecimalLiterals expectation with hex-alias force patch
Our driver patch forces an explicit alias `x'417a'` on hex literal SELECT items so Turso's implicit column naming doesn't mangle them. Update the Translation_Tests expectation strings to match.
1 parent 34dc1cd commit d09ee65

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/phpunit-tests-turso.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,21 @@ jobs:
11601160
open(path, 'w').write(new_src)
11611161
print(f'patched {n} Translation_Tests VALUES expectations to SELECT form')
11621162
1163+
# 14. Update Translation_Tests::testHexadecimalLiterals to match
1164+
# the hex-literal alias force patch (which needs to stay so
1165+
# Turso doesn't mangle x'417a' into 17a' at runtime).
1166+
src = open(path).read()
1167+
for old_q, new_q in [
1168+
("\"SELECT x'417a'\",\n\t\t\t\"SELECT x'417a'\"",
1169+
"\"SELECT x'417a' AS `x'417a'`\",\n\t\t\t\"SELECT x'417a'\""),
1170+
("\"SELECT X'417a'\",\n\t\t\t\"SELECT X'417a'\"",
1171+
"\"SELECT X'417a' AS `X'417a'`\",\n\t\t\t\"SELECT X'417a'\""),
1172+
]:
1173+
assert old_q in src, f'hex literal expectation not found: {old_q!r}'
1174+
src = src.replace(old_q, new_q, 1)
1175+
open(path, 'w').write(src)
1176+
print('patched Translation_Tests testHexadecimalLiterals expectations')
1177+
11631178
# 11. 6 Translation_Tests assert on the exact SQL emitted by
11641179
# sync_column_key_info. Our EXISTS rewrite (needed because
11651180
# Turso doesn't implement SQLite's "bare column alongside

0 commit comments

Comments
 (0)