MCPcopy Create free account
hub / github.com/astercloud/aster / TestCompressOptions_Defaults

Function TestCompressOptions_Defaults

pkg/agent/prompt_compression_test.go:181–198  ·  view source on GitHub ↗

TestCompressOptions_Defaults 测试默认选项

(t *testing.T)

Source from the content-addressed store, hash-verified

179
180// TestCompressOptions_Defaults 测试默认选项
181func 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 测试评分排序
201func TestScoredSection_Sorting(t *testing.T) {

Callers

nothing calls this directly

Calls 1

CompressMethod · 0.95

Tested by

no test coverage detected