TestCompressOptions_Defaults 测试默认选项
(t *testing.T)
| 179 | |
| 180 | // TestCompressOptions_Defaults 测试默认选项 |
| 181 | func TestCompressOptions_Defaults(t *testing.T) { |
| 182 | compressor := &EnhancedPromptCompressor{ |
| 183 | language: "zh", |
| 184 | } |
| 185 | |
| 186 | testPrompt := "Some test content\n\nAnother section" |
| 187 | |
| 188 | // 使用 nil 选项 |
| 189 | result, err := compressor.Compress(context.Background(), testPrompt, nil) |
| 190 | if err != nil { |
| 191 | t.Fatalf("Compress failed: %v", err) |
| 192 | } |
| 193 | |
| 194 | // 验证使用了默认模式 |
| 195 | if result.Mode != string(CompressionModeHybrid) { |
| 196 | t.Errorf("Expected default mode %s, got %s", CompressionModeHybrid, result.Mode) |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | // TestScoredSection_Sorting 测试评分排序 |
| 201 | func TestScoredSection_Sorting(t *testing.T) { |