Files
astro/geojson/occultation_venus_20250919_regression_test.go
T
b612 72460fa228 feat: 完善星表查询与跨版本回归验证
- 将星表名称数据收敛为 TSV/GZIP 单一数据源,补充中文名、别名、英文常用名及宿/垣区域字段
- 增加星表名称表加载校验、旧详情字段一致性校验和 GZIP 漂移检查
- 新增 StarDataByName、StarDataByNameAll、StarDataByNameIn ,统一中英文查询与重名消歧
- 优化日月食半影带、升落曲线和可见性回归测试,补充极区、拓扑及低精度场景覆盖
- 增加 Go 1.16/386 兼容门禁和测试案例,处理旧工具链的分配、拓扑、SVG字节及 ULP 差异
- 补充星表、坐标、日月食和低精度回归用例,完善测试文件与缓存忽略规则
2026-10-18 16:13:14 +08:00

40 lines
1.2 KiB
Go

package geojson_test
import (
"testing"
"time"
"b612.me/astro/geojson"
"b612.me/astro/moon"
)
func TestMarshalPlanetOccultationVenus20250919OptimizedContoursAreStrictlyOrdered(t *testing.T) {
skipHeavyOnGo116386(t)
day := time.Date(2025, 9, 19, 0, 0, 0, 0, time.UTC)
paths, err := moon.FindPlanetOccultationPaths(
day.Add(-12*time.Hour), day.Add(36*time.Hour), moon.OccultationVenus,
moon.OccultationPathOptions{
Step: 5 * time.Minute,
TargetSpacingKM: 300,
DisableFootprints: true,
RiseSetStep: 30 * time.Second,
},
)
if err != nil || len(paths) != 1 {
t.Fatalf("FindPlanetOccultationPaths paths=%d err=%v, want one path", len(paths), err)
}
if len(paths[0].PartialBandContours) != 2 {
t.Fatalf("partial contours=%d, want two", len(paths[0].PartialBandContours))
}
for contourIndex, contour := range paths[0].PartialBandContours {
for index := 1; index < len(contour); index++ {
if !contour[index].Time.After(contour[index-1].Time) {
t.Fatalf("contour %d sample %d is not strictly increasing: %s then %s", contourIndex, index, contour[index-1].Time, contour[index].Time)
}
}
}
if _, err := geojson.MarshalPlanetOccultation(paths[0]); err != nil {
t.Fatalf("MarshalPlanetOccultation: %v", err)
}
}