功能:完善里程边界与氢耗流式统计
This commit is contained in:
@@ -245,6 +245,16 @@ func TestDailyMileageSchemaIncludesPureHydrogenEvidence(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDailyMileageSchemaIncludesDayEndTotalMileage(t *testing.T) {
|
||||
const column = "day_end_total_mileage_km DECIMAL(18,3) NULL"
|
||||
if !strings.Contains(DailyMileageTableSQL, column) {
|
||||
t.Fatalf("daily mileage schema missing %q:\n%s", column, DailyMileageTableSQL)
|
||||
}
|
||||
if !containsStatement(DailyMileageAlterSQL, "ALTER TABLE vehicle_daily_mileage ADD COLUMN "+column) {
|
||||
t.Fatalf("daily mileage alter SQL missing %q: %#v", column, DailyMileageAlterSQL)
|
||||
}
|
||||
}
|
||||
|
||||
func containsStatement(statements []string, fragment string) bool {
|
||||
for _, statement := range statements {
|
||||
if strings.Contains(statement, fragment) {
|
||||
|
||||
Reference in New Issue
Block a user