mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-02-13 23:25:43 +08:00
将Index改为单例模式,防止状态不一致; 注意:测试为单进程,需要reset防止共享单例
This commit is contained in:
@@ -88,7 +88,7 @@ mod test {
|
||||
fn test_commit() {
|
||||
util::setup_test_with_clean_mit();
|
||||
|
||||
let index = super::Index::new();
|
||||
let index = super::Index::get_instance();
|
||||
let mut commit = super::Commit::new(&index, vec!["123".to_string(), "456".to_string()], "test".to_string());
|
||||
assert_eq!(commit.hash.len(), 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user