[test] add test for data files, & fix bugs