add unit tests for core/traits.cc