-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
241 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import os | ||
import sys | ||
|
||
from setuptools import setup | ||
from setuptools.extension import Extension | ||
|
||
from Cython.Build import cythonize | ||
|
||
import yammh3 | ||
|
||
|
||
def get_extensions(): | ||
kwargs = { | ||
'include_dirs': [yammh3.get_include()], | ||
} | ||
return cythonize([ | ||
Extension('tests._test_cimports', ['tests/_test_cimports.pyx'], **kwargs), | ||
]) | ||
|
||
|
||
setup( | ||
name='yammh3-tests', | ||
version='0.1.0', | ||
packages=['tests'], | ||
package_data={ | ||
"tests": ['*.pyx', '*.pxd'], | ||
}, | ||
ext_modules=get_extensions(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from yammh3._yammh3 cimport ( | ||
mhash128, mhash128s, | ||
mhash128_x64, mhash128s_x64, | ||
mhash64, mhash64s, mhash64l, mhash64sl, | ||
mhash64_x64, mhash64s_x64, mhash64l_x64, mhash64sl_x64, | ||
mhash32, mhash32s, | ||
) | ||
|
||
|
||
def test_cimports(bytes s, int n): | ||
mhash128(s, n) | ||
mhash128(s, n) | ||
mhash128s(s, n) | ||
mhash128_x64(s, n) | ||
mhash128s_x64(s, n) | ||
mhash64(s, n) | ||
mhash64s(s, n) | ||
mhash64l(s, n) | ||
mhash64sl(s, n) | ||
mhash64_x64(s, n) | ||
mhash64s_x64(s, n) | ||
mhash64l_x64(s, n) | ||
mhash64sl_x64(s, n) | ||
mhash32(s, n) | ||
mhash32s(s, n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from hypothesis import given, strategies as st | ||
|
||
from ._test_cimports import test_cimports as _test_cimports | ||
|
||
|
||
@given(st.text()) | ||
def test_cimports(value): | ||
b_value = value.encode('utf-8') | ||
_test_cimports(b_value, len(b_value)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters