(t *testing.T)
| 31 | } |
| 32 | |
| 33 | func TestContextInjector_InjectLocation(t *testing.T) { |
| 34 | location := &LocationInfo{ |
| 35 | City: "San Francisco", |
| 36 | Country: "USA", |
| 37 | Timezone: "America/Los_Angeles", |
| 38 | Language: "en-US", |
| 39 | } |
| 40 | |
| 41 | config := InjectorConfig{ |
| 42 | EnableLocation: true, |
| 43 | LocationProvider: NewSimpleLocationProvider(location), |
| 44 | } |
| 45 | |
| 46 | injector := NewContextInjector(config) |
| 47 | systemPrompt := "You are a helpful assistant." |
| 48 | |
| 49 | result := injector.InjectContext(context.Background(), systemPrompt) |
| 50 | |
| 51 | if !strings.Contains(result, "Location Information") { |
| 52 | t.Error("expected location context to be injected") |
| 53 | } |
| 54 | |
| 55 | if !strings.Contains(result, "San Francisco") { |
| 56 | t.Error("expected city to be included") |
| 57 | } |
| 58 | |
| 59 | if !strings.Contains(result, "USA") { |
| 60 | t.Error("expected country to be included") |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func TestContextInjector_InjectSessionState(t *testing.T) { |
| 65 | state := &SessionState{ |
nothing calls this directly
no test coverage detected