feat(Go-Tool):修复bitstore移位问题,修改单测

This commit is contained in:
Huangzj
2020-12-25 17:06:19 +08:00
parent 4b542c3cee
commit cdf5fa9f6b
2 changed files with 22 additions and 11 deletions
+12 -2
View File
@@ -47,25 +47,35 @@ func TestOneThousand(t *testing.T) {
newStoreMap(bitStore) //初始化的校验
fmt.Println()
bitStore.ReceiveByGear(3)
fmt.Println(fmt.Sprintf("这个时候领取结果 3应该返回true,结果是:%v", bitStore.IsGearReceive(3)))
bitStore.ReceiveByGear(1)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[0]))
fmt.Println(fmt.Sprintf("这个时候领取结果 1应该返回true,结果是:%v", bitStore.IsGearReceive(3)))
bitStore.ReceiveByGear(8)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[0]))
fmt.Println(fmt.Sprintf("这个时候领取结果 8应该返回true,结果是:%v", bitStore.IsGearReceive(8)))
bitStore.ReceiveByGear(16)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[0]))
fmt.Println(fmt.Sprintf("这个时候领取结果 16应该返回true,结果是:%v", bitStore.IsGearReceive(16)))
bitStore.ReceiveByGear(18)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[0]))
fmt.Println(fmt.Sprintf("这个时候领取结果 18应该返回true,结果是:%v", bitStore.IsGearReceive(18)))
bitStore.ReceiveByGear(27)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[0]))
fmt.Println(fmt.Sprintf("这个时候领取结果 27应该返回true,结果是:%v", bitStore.IsGearReceive(27)))
bitStore.ReceiveByGear(32)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[1]))
fmt.Println(fmt.Sprintf("这个时候领取结果 32应该返回true,结果是:%v", bitStore.IsGearReceive(32)))
bitStore.ReceiveByGear(33)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[1]))
fmt.Println(fmt.Sprintf("这个时候领取结果 33应该返回true,结果是:%v", bitStore.IsGearReceive(33)))
bitStore.ReceiveByGear(53)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[1]))
fmt.Println(fmt.Sprintf("这个时候领取结果 53应该返回true,结果是:%v", bitStore.IsGearReceive(53)))
bitStore.ReceiveByGear(44)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[1]))
fmt.Println(fmt.Sprintf("这个时候领取结果 44应该返回true,结果是:%v", bitStore.IsGearReceive(44)))
bitStore.ReceiveByGear(48)
fmt.Println(fmt.Sprintf("%b", bitStore.GearPickList[1]))
fmt.Println(fmt.Sprintf("判断当前数组是否动态增长,当前数组长度为:%d", len(bitStore.GearPickList)))