Skip to content

Commit d7cdfb3

Browse files
committed
Test that from_global_id handles invalid code point
Replicates graphql/graphql-relay-js@6530b83
1 parent 4c69f4f commit d7cdfb3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/connection/test_array_connection.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,18 @@ def throws_an_error_if_last_smaller_than_zero():
258258
)
259259

260260
def returns_all_elements_if_cursors_are_invalid():
261-
c = connection_from_array(
262-
array_abcde, dict(before="invalid", after="invalid")
261+
c1 = connection_from_array(
262+
array_abcde, dict(before="InvalidBase64", after="InvalidBase64")
263263
)
264-
assert c == Connection(
264+
265+
invalid_unicode_in_base64 = "9JCAgA==" # U+110000
266+
c2 = connection_from_array(
267+
array_abcde,
268+
dict(before=invalid_unicode_in_base64, after=invalid_unicode_in_base64),
269+
)
270+
271+
assert c1 == c2
272+
assert c1 == Connection(
265273
edges=[edge_a, edge_b, edge_c, edge_d, edge_e],
266274
pageInfo=PageInfo(
267275
startCursor=cursor_a,

0 commit comments

Comments
 (0)