From 0b54a1b41ce1db5e937f89ccecb559053484cbd8 Mon Sep 17 00:00:00 2001 From: Jongbin Jung Date: Sat, 5 Oct 2024 12:43:00 -0700 Subject: [PATCH] Add test for string subtypes --- tests/test_apis/test_basic_str.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_apis/test_basic_str.py b/tests/test_apis/test_basic_str.py index 0c65a827..fccc164f 100644 --- a/tests/test_apis/test_basic_str.py +++ b/tests/test_apis/test_basic_str.py @@ -22,3 +22,22 @@ def test5(): out = h3.grid_disk('8928308280fffff', 1) assert u.same_set(out, expected) + + +def test_string_subtypes(): + + class my_str(str): + pass + + expected = [ + '89283082873ffff', + '89283082877ffff', + '8928308283bffff', + '89283082807ffff', + '8928308280bffff', + '8928308280fffff', + '89283082803ffff' + ] + + out = h3.grid_disk(my_str('8928308280fffff'), 1) + assert u.same_set(out, expected)