(t *testing.T)
| 723 | } |
| 724 | |
| 725 | func TestManager_GetByPrefix(t *testing.T) { |
| 726 | mgr := NewManager(10 * time.Minute) |
| 727 | s1 := mgr.Touch("key1", "agent/1.0", "openai", "abcdef123456") |
| 728 | mgr.Touch("key2", "agent/2.0", "openai", "xyz789000000") |
| 729 | |
| 730 | // Exact prefix match. |
| 731 | if got := mgr.GetByPrefix("abcdef"); got == nil || got.ID != s1.ID { |
| 732 | t.Errorf("prefix 'abcdef' should match session %s", s1.ID) |
| 733 | } |
| 734 | // No match. |
| 735 | if got := mgr.GetByPrefix("zzz"); got != nil { |
| 736 | t.Error("prefix 'zzz' should return nil") |
| 737 | } |
| 738 | // Empty prefix. |
| 739 | if got := mgr.GetByPrefix(""); got != nil { |
| 740 | t.Error("empty prefix should return nil") |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | // =================================================================== |
| 745 | // E. Transfer Planning Tests |
nothing calls this directly
no test coverage detected