From 96bee0739dc75584c8984ede3ebde2b8d35bd573 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Thu, 12 Dec 2024 11:31:15 -0500 Subject: [PATCH] test hex support --- tests/test_pytypes.cpp | 4 ++-- tests/test_pytypes.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_pytypes.cpp b/tests/test_pytypes.cpp index fb91fde7f9..1faaac577e 100644 --- a/tests/test_pytypes.cpp +++ b/tests/test_pytypes.cpp @@ -123,7 +123,7 @@ namespace literals { enum Color { RED = 0, BLUE = 1 }; typedef py::typing::Literal<26, - "0x1A", + 0x1A, "\"hello world\"", "b\"hello world\"", "u\"hello world\"", @@ -985,7 +985,7 @@ TEST_SUBMODULE(pytypes, m) { #if defined(PYBIND11_CPP17) m.def("annotate_literal", - [](py::typing::Literal<3, 6, 1, 0, true, false> &o) -> py::object { return o; }); + [](py::typing::Literal<3, 6, 1, 0, true, false, 0x14> &o) -> py::object { return o; }); m.attr("PYBIND11_CPP17") = true; #else diff --git a/tests/test_pytypes.py b/tests/test_pytypes.py index e7a9d9fb75..be748872ed 100644 --- a/tests/test_pytypes.py +++ b/tests/test_pytypes.py @@ -1042,7 +1042,7 @@ def test_optional_object_annotations(doc): def test_literal(doc): assert ( doc(m.annotate_literal) - == "annotate_literal(arg0: Literal[3, 6, 1, 0, True, False]) -> object" + == "annotate_literal(arg0: Literal[3, 6, 1, 0, True, False, 20]) -> object" ) @@ -1053,7 +1053,7 @@ def test_literal(doc): def test_complete_literal(doc): assert ( doc(m.annotate_complete_literal) - == 'annotate_literal(arg0: Literal[26, 0x1A, "hello world", b"hello world", u"hello world", True, Color.RED, None]) -> object' + == 'annotate_literal(arg0: Literal[26, 20 "hello world", b"hello world", u"hello world", True, Color.RED, None]) -> object' )