add unittest for main