Add unit test.

Signed-off-by: CyberZHG <CyberZHG@gmail.com>