add func and unit test
Merge pull request #1 from takumatz/add-unit-tests

Okey