Commit df35f9ea authored by Konstantin Baierer's avatar Konstantin Baierer
Browse files

testing: move smoke tests in utils.py to run-unit

parent d79fb4dc
......@@ -12,8 +12,3 @@ def sumprod(u,v,out=None):
n = u.shape[1]
out = np.zeros(n)
return np.einsum('ki,ki->i',u,v,out=out)
def test():
from pylab import randn
sumouter(randn(11,3),randn(11,4),out=randn(3,4))
sumprod(randn(11,7),randn(11,7),out=randn(7))
......@@ -2,7 +2,7 @@
import sys
from ocrolib import edist
from ocrolib import edist, utils
# Test the levenshtein function and returns 0 if the computed value
# equals the one it should be, otherwise returns 1 for failed tests.
......@@ -44,4 +44,11 @@ failed_tests += testXLevenshtein('', 'test', 1, should=(4.0, []))
failed_tests += testXLevenshtein('aaaaaaaaaaa', 'a', 1, should=(10.0, [('aaaaaaaaaaa ', 'a__________ ')]))
failed_tests += testXLevenshtein('123 111 456', '132 111 444', 1, should=(4.0, [('123_ ', '1_32 '), ('456 ', '444 ')]))
print('\n# 3 utils.sumouter / utils.sumprod')
from pylab import randn
utils.sumouter(randn(10,3),randn(10,4),out=randn(3,4))
print('ok - dimensions of sumouter')
utils.sumprod(randn(11,7),randn(11,7),out=randn(7))
print('ok - dimensions of sumprod')
sys.exit(failed_tests)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment