测试:完善和优化测试用例
- 优化 schema 测试用例,增加边界条件测试 - 完善 table、index、database 等模块的测试 - 改进测试数据清理和错误处理 - 更新示例程序以使用最新 API - 增强测试覆盖率和可靠性
This commit is contained in:
5
table.go
5
table.go
@@ -80,7 +80,10 @@ func OpenTable(opts *TableOptions) (*Table, error) {
|
||||
var sch *Schema
|
||||
if opts.Name != "" && len(opts.Fields) > 0 {
|
||||
// 从 Name 和 Fields 创建 Schema
|
||||
sch = NewSchema(opts.Name, opts.Fields)
|
||||
sch, err = NewSchema(opts.Name, opts.Fields)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create schema: %w", err)
|
||||
}
|
||||
// 保存到磁盘(带校验和)
|
||||
schemaPath := filepath.Join(opts.Dir, "schema.json")
|
||||
schemaFile, err := NewSchemaFile(sch)
|
||||
|
||||
Reference in New Issue
Block a user