MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_function_overloading

Function test_function_overloading

tests/test_constants_and_functions.py:12–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def test_function_overloading():
13 assert m.test_function() == "test_function()"
14 assert m.test_function(7) == "test_function(7)"
15 assert m.test_function(m.MyEnum.EFirstEntry) == "test_function(enum=1)"
16 assert m.test_function(m.MyEnum.ESecondEntry) == "test_function(enum=2)"
17
18 assert m.test_function() == "test_function()"
19 assert m.test_function("abcd") == "test_function(char *)"
20 assert m.test_function(1, 1.0) == "test_function(int, float)"
21 assert m.test_function(1, 1.0) == "test_function(int, float)"
22 assert m.test_function(2.0, 2) == "test_function(float, int)"
23
24
25def test_bytes():

Callers

nothing calls this directly

Calls 1

test_functionMethod · 0.80

Tested by

no test coverage detected