docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// 画布与资产纯函数回归;测试说明对应实际断言,不依赖浏览器或真实模型。
|
||||
package platform
|
||||
|
||||
import (
|
||||
@@ -10,6 +11,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestCanvasV2EdgeRoundTrip 保存带外观、动画、曲线和执行配置的 v2 边,并逐项破坏范围/枚举/切线关系,验证不丢字段且拒绝非法配置。
|
||||
func TestCanvasV2EdgeRoundTrip(t *testing.T) {
|
||||
raw := strings.Replace(canvasFixture, `"schema_version":1`, `"schema_version":2`, 1)
|
||||
data := `{"appearance":{"color":"#AA968B","width":2,"opacity":1,"line":"dashed","head":{"type":"triangle","size":12,"filled":true},"tail":{"type":"circle","size":8,"filled":false}},"animation":{"mode":"executing","effect":"flow","direction":"reverse","durationMs":1600,"color":"#FFFFFF"},"path":{"type":"bezier-chain","startControl":{"x":90,"y":0},"endControl":{"x":-90,"y":0},"knots":[{"id":"k1","position":{"x":450,"y":280},"in":{"x":-60,"y":0},"out":{"x":60,"y":0},"mode":"symmetric"}]},"execution":{"enabled":true}}`
|
||||
@@ -39,6 +41,7 @@ func TestCanvasV2EdgeRoundTrip(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestCanvasSchemaAccept 验证媒体类型列表中的显式 version=2 协商,拒绝 q=0、NaN 和相似但不同的版本号。
|
||||
func TestCanvasSchemaAccept(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
accept string
|
||||
@@ -59,6 +62,7 @@ func TestCanvasSchemaAccept(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestCanvasV2CurveLimits 检查 64 个 knot 的边界、重复 knot ID 及非有限/越界点;直接构造 float64 覆盖 JSON 不表示的 NaN。
|
||||
func TestCanvasV2CurveLimits(t *testing.T) {
|
||||
knot := func(id string) map[string]any {
|
||||
return map[string]any{"id": id, "position": map[string]any{"x": 0.0, "y": 0.0}, "in": map[string]any{"x": -1.0, "y": 0.0}, "out": map[string]any{"x": 1.0, "y": 0.0}, "mode": "smooth"}
|
||||
@@ -86,6 +90,7 @@ func TestCanvasV2CurveLimits(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestCanvasV2AppearanceAndAnimationEnums 遍历受支持标记/线型与动画模式/效果/方向的组合,保证合法枚举组合可被接受。
|
||||
func TestCanvasV2AppearanceAndAnimationEnums(t *testing.T) {
|
||||
for _, marker := range []string{"none", "open-arrow", "triangle", "circle", "diamond", "square"} {
|
||||
for _, line := range []string{"solid", "dashed", "dotted"} {
|
||||
|
||||
Reference in New Issue
Block a user