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

Function TestContextInjector_InjectDateTime

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

Source from the content-addressed store, hash-verified

8)
9
10func TestContextInjector_InjectDateTime(t *testing.T) {
11 config := InjectorConfig{
12 EnableDateTime: true,
13 }
14
15 injector := NewContextInjector(config)
16 systemPrompt := "You are a helpful assistant."
17
18 result := injector.InjectContext(context.Background(), systemPrompt)
19
20 if !strings.Contains(result, "Current Date and Time") {
21 t.Error("expected date time context to be injected")
22 }
23
24 if !strings.Contains(result, "Date:") {
25 t.Error("expected date to be included")
26 }
27
28 if !strings.Contains(result, "Time:") {
29 t.Error("expected time to be included")
30 }
31}
32
33func TestContextInjector_InjectLocation(t *testing.T) {
34 location := &LocationInfo{

Callers

nothing calls this directly

Calls 3

InjectContextMethod · 0.95
NewContextInjectorFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected