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

Function TestContextInjector_MultipleContexts

pkg/context/auto_inject_test.go:97–120  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestContextInjector_MultipleContexts(t *testing.T) {
98 config := InjectorConfig{
99 EnableDateTime: true,
100 EnableSystemInfo: true,
101 CustomContext: "Custom context information",
102 }
103
104 injector := NewContextInjector(config)
105 systemPrompt := "You are a helpful assistant."
106
107 result := injector.InjectContext(context.Background(), systemPrompt)
108
109 if !strings.Contains(result, "Current Date and Time") {
110 t.Error("expected date time context")
111 }
112
113 if !strings.Contains(result, "System Information") {
114 t.Error("expected system info context")
115 }
116
117 if !strings.Contains(result, "Custom context information") {
118 t.Error("expected custom context")
119 }
120}

Callers

nothing calls this directly

Calls 3

InjectContextMethod · 0.95
NewContextInjectorFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected